home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / CIncludes / OCEAuthDir.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-18  |  174.3 KB  |  4,513 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        OCEAuthDir.h
  3.  
  4.      Contains:    Apple Open Collaboration Environment Authentication Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __OCEAUTHDIR__
  21. #define __OCEAUTHDIR__
  22.  
  23.  
  24. #ifndef __EVENTS__
  25. #include <Events.h>
  26. #endif
  27. /*    #include <Types.h>                                            */
  28. /*        #include <ConditionalMacros.h>                            */
  29. /*    #include <Quickdraw.h>                                        */
  30. /*        #include <MixedMode.h>                                    */
  31. /*        #include <QuickdrawText.h>                                */
  32. /*    #include <OSUtils.h>                                        */
  33. /*        #include <Memory.h>                                        */
  34.  
  35. #ifndef __NOTIFICATION__
  36. #include <Notification.h>
  37. #endif
  38.  
  39. #ifndef __APPLEEVENTS__
  40. #include <AppleEvents.h>
  41. #endif
  42. /*    #include <Errors.h>                                            */
  43. /*    #include <EPPC.h>                                            */
  44. /*        #include <AppleTalk.h>                                    */
  45. /*        #include <Files.h>                                        */
  46. /*        #include <PPCToolbox.h>                                    */
  47. /*        #include <Processes.h>                                    */
  48.  
  49. #ifndef __APPLETALK__
  50. #include <AppleTalk.h>
  51. #endif
  52.  
  53. #ifndef __FILES__
  54. #include <Files.h>
  55. #endif
  56.  
  57. #ifndef __OSUTILS__
  58. #include <OSUtils.h>
  59. #endif
  60.  
  61. #ifndef __TYPES__
  62. #include <Types.h>
  63. #endif
  64.  
  65. #ifndef __OCE__
  66. #include <OCE.h>
  67. #endif
  68. /*    #include <Aliases.h>                                        */
  69. /*    #include <Script.h>                                            */
  70. /*        #include <IntlResources.h>                                */
  71.  
  72. #ifdef __cplusplus
  73. extern "C" {
  74. #endif
  75.  
  76. #if PRAGMA_ALIGN_SUPPORTED
  77. #pragma options align=mac68k
  78. #endif
  79.  
  80. #if PRAGMA_IMPORT_SUPPORTED
  81. #pragma import on
  82. #endif
  83.  
  84.  
  85. enum {
  86.     kRC4KeySizeInBytes            = 8,                            /* size of an RC4 key */
  87.     kRefNumUnknown                = 0
  88. };
  89.  
  90. enum {
  91.     kEnumDistinguishedNameBit,
  92.     kEnumAliasBit,
  93.     kEnumPseudonymBit,
  94.     kEnumDNodeBit,
  95.     kEnumInvisibleBit
  96. };
  97.  
  98. /* Values of DirEnumChoices */
  99. enum {
  100.     kEnumDistinguishedNameMask    = 1L << kEnumDistinguishedNameBit,
  101.     kEnumAliasMask                = 1L << kEnumAliasBit,
  102.     kEnumPseudonymMask            = 1L << kEnumPseudonymBit,
  103.     kEnumDNodeMask                = 1L << kEnumDNodeBit,
  104.     kEnumInvisibleMask            = 1L << kEnumInvisibleBit,
  105.     kEnumAllMask                = (kEnumDistinguishedNameMask | kEnumAliasMask | kEnumPseudonymMask | kEnumDNodeMask | kEnumInvisibleMask)
  106. };
  107.  
  108. typedef unsigned long DirEnumChoices;
  109.  
  110. /* Values of DirSortOption */
  111.  
  112. enum {
  113.     kSortByName                    = 0,
  114.     kSortByType                    = 1
  115. };
  116.  
  117. /* Values of DirSortDirection */
  118. enum {
  119.     kSortForwards                = 0,
  120.     kSortBackwards                = 1
  121. };
  122.  
  123. /* Values of DirMatchWith */
  124. enum {
  125.     kMatchAll,
  126.     kExactMatch,
  127.     kBeginsWith,
  128.     kEndingWith,
  129.     kContaining
  130. };
  131.  
  132. typedef unsigned char DirMatchWith;
  133.  
  134.  
  135. enum {
  136.     kCurrentOCESortVersion        = 1
  137. };
  138.  
  139. /*  Access controls are implemented on three levels:
  140.  *      DNode, Record, and Attribute Type levels
  141.  *  Some access control bits apply to the container itself, and some apply to its contents.
  142.  *
  143.  *  The Catalog Toolbox supports six functions.  These calls are:
  144.  *  DSGetDNodeAccessControl : to get Access Controls at the DNode level
  145.  *    DSGetRecordAccessControl  : to get Access Controls at the record level
  146.  *  DSGetAttributeAccessControl : to get Access Privileges at the attribute type level
  147.  * 
  148.  *  The GetXXXAccessControl calls will return access control masks for various categories
  149.  *  of users.  Please refer to the access control document for a description of the
  150.  *  categories of users.  In general these are:
  151.  *      ThisRecordOwner         - means the identity of the record itself
  152.  *      Friends                  - means any one of the assigned friends for the record
  153.  *      AuthenticatedInDNode     - means any valid user that is an authenticated entity
  154.  *          in the DNode in which this record is located
  155.  *      AuthenticatedInDirectory - means any valid authenticated catalog user
  156.  *      Guest                      - means an unauthenticated user.
  157.  *  Bit masks for various permitted access controls are defined below.
  158.  *
  159.  *  GetXXXAccessControl calls will return access control masks for various categories of
  160.  *  users for this record. In addition they also return the level of access controls
  161.  *  that the user (who is making the GetXXXAccessControl call) has for the DNode,
  162.  *  record, or attribute type.
  163.  *
  164.  *  For records, the access control granted will be minimum of the DNode access
  165.  *  control and record access control masks.  For example, to add an attribute type to a
  166.  *  record, a user must have access control kCreateAttributeTypes at the record and
  167.  *  DNode levels.  Similarly, at the attribute type level, access controls will be the
  168.  *  minimum of the DNode, record, and attribute type access controls.
  169.  *
  170.  *  
  171.  */
  172. /* access categories bit numbers */
  173. enum {
  174.     kThisRecordOwnerBit            = 0,
  175.     kFriendsBit                    = 1,
  176.     kAuthenticatedInDNodeBit    = 2,
  177.     kAuthenticatedInDirectoryBit = 3,
  178.     kGuestBit                    = 4,
  179.     kMeBit                        = 5
  180. };
  181.  
  182. /* Values of CategoryMask */
  183. enum {
  184.     kThisRecordOwnerMask        = (1L << kThisRecordOwnerBit),
  185.     kFriendsMask                = (1L << kFriendsBit),
  186.     kAuthenticatedInDNodeMask    = (1L << kAuthenticatedInDNodeBit),
  187.     kAuthenticatedInDirectoryMask = (1L << kAuthenticatedInDirectoryBit),
  188.     kGuestMask                    = (1L << kGuestBit),
  189.     kMeMask                        = (1L << kMeBit)
  190. };
  191.  
  192. enum {
  193.     kSeeBit                        = 0,
  194.     kAddBit                        = 1,
  195.     kDeleteBit                    = 2,
  196.     kChangeBit                    = 3,
  197.     kRenameBit                    = 4,
  198.     kChangePrivsBit                = 5,
  199.     kSeeFoldersBit                = 6
  200. };
  201.  
  202. /* Values of AccessMask */
  203. enum {
  204.     kSeeMask                    = (1L << kSeeBit),
  205.     kAddMask                    = (1L << kAddBit),
  206.     kDeleteMask                    = (1L << kDeleteBit),
  207.     kChangeMask                    = (1L << kChangeBit),
  208.     kRenameMask                    = (1L << kRenameBit),
  209.     kChangePrivsMask            = (1L << kChangePrivsBit),
  210.     kSeeFoldersMask                = (1L << kSeeFoldersBit)
  211. };
  212.  
  213. enum {
  214.     kAllPrivs                    = (kSeeMask + kAddMask + kDeleteMask + kChangeMask + kRenameMask + kChangePrivsMask + kSeeFoldersMask),
  215.     kNoPrivs                    = 0
  216. };
  217.  
  218. enum {
  219.     kSupportsDNodeNumberBit        = 0,
  220.     kSupportsRecordCreationIDBit = 1,
  221.     kSupportsAttributeCreationIDBit = 2,
  222.     kSupportsMatchAllBit        = 3,
  223.     kSupportsBeginsWithBit        = 4,
  224.     kSupportsExactMatchBit        = 5,
  225.     kSupportsEndsWithBit        = 6,
  226.     kSupportsContainsBit        = 7,
  227.     kSupportsOrderedEnumerationBit = 8,
  228.     kCanSupportNameOrderBit        = 9,
  229.     kCanSupportTypeOrderBit        = 10,
  230.     kSupportSortBackwardsBit    = 11,
  231.     kSupportIndexRatioBit        = 12,
  232.     kSupportsEnumerationContinueBit = 13,
  233.     kSupportsLookupContinueBit    = 14,
  234.     kSupportsEnumerateAttributeTypeContinueBit = 15,
  235.     kSupportsEnumeratePseudonymContinueBit = 16,
  236.     kSupportsAliasesBit            = 17,
  237.     kSupportsPseudonymsBit        = 18,
  238.     kSupportsPartialPathNamesBit = 19,
  239.     kSupportsAuthenticationBit    = 20,
  240.     kSupportsProxiesBit            = 21,
  241.     kSupportsFindRecordBit        = 22
  242. };
  243.  
  244. /* values of DirGestalt */
  245. enum {
  246.     kSupportsDNodeNumberMask    = 1L << kSupportsDNodeNumberBit,
  247.     kSupportsRecordCreationIDMask = 1L << kSupportsRecordCreationIDBit,
  248.     kSupportsAttributeCreationIDMask = 1L << kSupportsAttributeCreationIDBit,
  249.     kSupportsMatchAllMask        = 1L << kSupportsMatchAllBit,
  250.     kSupportsBeginsWithMask        = 1L << kSupportsBeginsWithBit,
  251.     kSupportsExactMatchMask        = 1L << kSupportsExactMatchBit,
  252.     kSupportsEndsWithMask        = 1L << kSupportsEndsWithBit,
  253.     kSupportsContainsMask        = 1L << kSupportsContainsBit,
  254.     kSupportsOrderedEnumerationMask = 1L << kSupportsOrderedEnumerationBit,
  255.     kCanSupportNameOrderMask    = 1L << kCanSupportNameOrderBit,
  256.     kCanSupportTypeOrderMask    = 1L << kCanSupportTypeOrderBit,
  257.     kSupportSortBackwardsMask    = 1L << kSupportSortBackwardsBit,
  258.     kSupportIndexRatioMask        = 1L << kSupportIndexRatioBit,
  259.     kSupportsEnumerationContinueMask = 1L << kSupportsEnumerationContinueBit,
  260.     kSupportsLookupContinueMask    = 1L << kSupportsLookupContinueBit,
  261.     kSupportsEnumerateAttributeTypeContinueMask = 1L << kSupportsEnumerateAttributeTypeContinueBit,
  262.     kSupportsEnumeratePseudonymContinueMask = 1L << kSupportsEnumeratePseudonymContinueBit,
  263.     kSupportsAliasesMask        = 1L << kSupportsAliasesBit,
  264.     kSupportsPseudonymsMask        = 1L << kSupportsPseudonymsBit,
  265.     kSupportsPartialPathNamesMask = 1L << kSupportsPartialPathNamesBit,
  266.     kSupportsAuthenticationMask    = 1L << kSupportsAuthenticationBit,
  267.     kSupportsProxiesMask        = 1L << kSupportsProxiesBit,
  268.     kSupportsFindRecordMask        = 1L << kSupportsFindRecordBit
  269. };
  270.  
  271. enum {
  272.     kAuthLockLocalIdentityOp    = 1,
  273.     kAuthUnlockLocalIdentityOp    = 2,
  274.     kAuthLocalIdentityNameChangeOp = 3
  275. };
  276.  
  277. /* Values of AuthLocalIdentityLockAction */
  278. enum {
  279.     kAuthLockPending            = 1,
  280.     kAuthLockWillBeDone            = 2
  281. };
  282.  
  283. /* Values of AuthNotifications */
  284. enum {
  285.     kNotifyLockBit,
  286.     kNotifyUnlockBit,
  287.     kNotifyNameChangeBit
  288. };
  289.  
  290. enum {
  291.     kNotifyLockMask                = 1L << kNotifyLockBit,
  292.     kNotifyUnlockMask            = 1L << kNotifyUnlockBit,
  293.     kNotifyNameChangeMask        = 1L << kNotifyNameChangeBit
  294. };
  295.  
  296. enum {
  297.     kPersonalDirectoryFileCreator = 'kl03',
  298.     kPersonalDirectoryFileType    = 'pabt',
  299.     kBusinessCardFileType        = 'bust',
  300.     kDirectoryFileType            = 'dirt',
  301.     kDNodeFileType                = 'dnod',
  302.     kDirsRootFileType            = 'drtt',
  303.     kRecordFileType                = 'rcrd'
  304. };
  305.  
  306. typedef unsigned short DirSortOption;
  307.  
  308. typedef unsigned short DirSortDirection;
  309.  
  310. typedef unsigned long CategoryMask;
  311.  
  312. typedef unsigned long AccessMask;
  313.  
  314. typedef unsigned long DirGestalt;
  315.  
  316. typedef unsigned long AuthLocalIdentityOp;
  317.  
  318. typedef unsigned long AuthLocalIdentityLockAction;
  319.  
  320. typedef unsigned long AuthNotifications;
  321.  
  322. struct DNodeID {
  323.     DNodeNum                        dNodeNumber;                /* dNodenumber  */
  324.     long                            reserved1;
  325.     RStringPtr                        name;
  326.     long                            reserved2;
  327. };
  328. typedef struct DNodeID DNodeID;
  329.  
  330. struct DirEnumSpec {
  331.     DirEnumChoices                    enumFlag;
  332.     unsigned short                    indexRatio;                    /* Approx Record Position between 1 and 100 If supported, 0 If not supported */
  333.     union {
  334.         LocalRecordID                    recordIdentifier;
  335.         DNodeID                            dNodeIdentifier;
  336.     } u;
  337. };
  338.  
  339. typedef struct DirEnumSpec DirEnumSpec;
  340.  
  341. struct DirMetaInfo {
  342.     unsigned long                    info[4];
  343. };
  344. typedef struct DirMetaInfo DirMetaInfo;
  345.  
  346. struct SLRV {
  347.     ScriptCode                        script;                        /*   Script code in which entries are sorted */
  348.     short                            language;                    /*   Language code in which entries are sorted */
  349.     short                            regionCode;                    /*   Region code in which entries are sorted */
  350.     short                            version;                    /*  version of oce sorting software */
  351. };
  352. typedef struct SLRV SLRV;
  353.  
  354. /* Catalog types and operations */
  355. /* unique identifier for an identity */
  356. typedef unsigned long AuthIdentity;
  357.  
  358. /* Umbrella LocalIdentity */
  359. typedef AuthIdentity LocalIdentity;
  360.  
  361. /* A DES key is 8 bytes of data */
  362. struct DESKey {
  363.     unsigned long                    a;
  364.     unsigned long                    b;
  365. };
  366. typedef struct DESKey DESKey;
  367.  
  368. typedef Byte RC4Key[kRC4KeySizeInBytes];
  369.  
  370. typedef unsigned long AuthKeyType;
  371.  
  372. /* key type followed by its data */
  373. struct AuthKey {
  374.     AuthKeyType                        keyType;
  375.     union {
  376.         DESKey                            des;
  377.         RC4Key                            rc4;
  378.     } u;
  379. };
  380.  
  381. typedef struct AuthKey AuthKey;
  382.  
  383. typedef AuthKey *AuthKeyPtr;
  384.  
  385. typedef union AuthParamBlock AuthParamBlock;
  386.  
  387. typedef AuthParamBlock *AuthParamBlockPtr;
  388.  
  389. typedef pascal void (*AuthIOCompletionProcPtr)(AuthParamBlockPtr paramBlock);
  390.  
  391. #if GENERATINGCFM
  392. typedef UniversalProcPtr AuthIOCompletionUPP;
  393. #else
  394. typedef AuthIOCompletionProcPtr AuthIOCompletionUPP;
  395. #endif
  396.  
  397. #define AuthParamHeader         \
  398.     Ptr    qLink;                        \
  399.     long    reserved1;                \
  400.     long    reserved2;                \
  401.     AuthIOCompletionUPP    ioCompletion;     \
  402.     OSErr    ioResult;                \
  403.     unsigned long    saveA5;            \
  404.     short    reqCode;                    \
  405.     long    reserved[2];                \
  406.     AddrBlock    serverHint;            \
  407.     short    dsRefNum;                \
  408.     unsigned long    callID;            \
  409.     AuthIdentity    identity;            \
  410.     long    gReserved1;                \
  411.     long    gReserved2;                \
  412.     long    gReserved3;                \
  413.     long    clientData;
  414. struct AuthResolveCreationIDPB {
  415.     Ptr                                qLink;
  416.     long                            reserved1;
  417.     long                            reserved2;
  418.     AuthIOCompletionUPP                ioCompletion;
  419.     OSErr                            ioResult;
  420.     unsigned long                    saveA5;
  421.     short                            reqCode;
  422.     long                            reserved[2];
  423.     AddrBlock                        serverHint;
  424.     short                            dsRefNum;
  425.     unsigned long                    callID;
  426.     AuthIdentity                    identity;
  427.     long                            gReserved1;
  428.     long                            gReserved2;
  429.     long                            gReserved3;
  430.     long                            clientData;
  431.     RecordIDPtr                        userRecord;                    /*  --> OCE name(Record) of the user */
  432.     unsigned long                    bufferLength;                /*  --> Buffer Size to hold duplicate Info */
  433.     Ptr                                buffer;                        /*  --> Buffer  to hold duplicate Info */
  434.     unsigned long                    totalMatches;                /* <--  Total Number of matching names found */
  435.     unsigned long                    actualMatches;                /* <--  Number of matches returned in the buffer */
  436. };
  437. typedef struct AuthResolveCreationIDPB AuthResolveCreationIDPB;
  438.  
  439. /*
  440. kAuthBindSpecificIdentity:
  441. userRecord will contain the user information whose identity has to be
  442. verified. userKey will contain the userKey. An Identity is returned which
  443. binds the key and the userRecord. The identity returned can be used in the 'identity'
  444. field in the header portion (AuthParamHeader) for authenticating the Catalog and
  445. Authentication manager calls.
  446. */
  447. struct AuthBindSpecificIdentityPB {
  448.     Ptr                                qLink;
  449.     long                            reserved1;
  450.     long                            reserved2;
  451.     AuthIOCompletionUPP                ioCompletion;
  452.     OSErr                            ioResult;
  453.     unsigned long                    saveA5;
  454.     short                            reqCode;
  455.     long                            reserved[2];
  456.     AddrBlock                        serverHint;
  457.     short                            dsRefNum;
  458.     unsigned long                    callID;
  459.     AuthIdentity                    identity;
  460.     long                            gReserved1;
  461.     long                            gReserved2;
  462.     long                            gReserved3;
  463.     long                            clientData;
  464.     AuthIdentity                    userIdentity;                /* <--  binding identity */
  465.     RecordIDPtr                        userRecord;                    /*  --> OCE name(Record) of the user */
  466.     AuthKeyPtr                        userKey;                    /*  --> OCE Key for the user */
  467. };
  468. typedef struct AuthBindSpecificIdentityPB AuthBindSpecificIdentityPB;
  469.  
  470. /*
  471. kAuthUnbindSpecificIdentity:
  472. This call will unbind the userRecord and key which were bind earlier.
  473. */
  474. struct AuthUnbindSpecificIdentityPB {
  475.     Ptr                                qLink;
  476.     long                            reserved1;
  477.     long                            reserved2;
  478.     AuthIOCompletionUPP                ioCompletion;
  479.     OSErr                            ioResult;
  480.     unsigned long                    saveA5;
  481.     short                            reqCode;
  482.     long                            reserved[2];
  483.     AddrBlock                        serverHint;
  484.     short                            dsRefNum;
  485.     unsigned long                    callID;
  486.     AuthIdentity                    identity;
  487.     long                            gReserved1;
  488.     long                            gReserved2;
  489.     long                            gReserved3;
  490.     long                            clientData;
  491.     AuthIdentity                    userIdentity;                /*  --> identity to be deleted */
  492. };
  493. typedef struct AuthUnbindSpecificIdentityPB AuthUnbindSpecificIdentityPB;
  494.  
  495. /*
  496. kAuthGetSpecificIdentityInfo:
  497. This call will return the userRecord for the given identity. Note: key is not
  498. returned because this would compromise security.
  499. */
  500. struct AuthGetSpecificIdentityInfoPB {
  501.     Ptr                                qLink;
  502.     long                            reserved1;
  503.     long                            reserved2;
  504.     AuthIOCompletionUPP                ioCompletion;
  505.     OSErr                            ioResult;
  506.     unsigned long                    saveA5;
  507.     short                            reqCode;
  508.     long                            reserved[2];
  509.     AddrBlock                        serverHint;
  510.     short                            dsRefNum;
  511.     unsigned long                    callID;
  512.     AuthIdentity                    identity;
  513.     long                            gReserved1;
  514.     long                            gReserved2;
  515.     long                            gReserved3;
  516.     long                            clientData;
  517.     AuthIdentity                    userIdentity;                /*  --> identity of initiator */
  518.     RecordIDPtr                        userRecord;                    /* <--  OCE name(Record) of the user */
  519. };
  520. typedef struct AuthGetSpecificIdentityInfoPB AuthGetSpecificIdentityInfoPB;
  521.  
  522. /*
  523. kAuthAddKey:
  524. userRecord will contain the user information whose identity has to be
  525. created. userKey will point to the key to be created. password points to
  526. an RString containing the password used to generate the key.
  527. */
  528. struct AuthAddKeyPB {
  529.     Ptr                                qLink;
  530.     long                            reserved1;
  531.     long                            reserved2;
  532.     AuthIOCompletionUPP                ioCompletion;
  533.     OSErr                            ioResult;
  534.     unsigned long                    saveA5;
  535.     short                            reqCode;
  536.     long                            reserved[2];
  537.     AddrBlock                        serverHint;
  538.     short                            dsRefNum;
  539.     unsigned long                    callID;
  540.     AuthIdentity                    identity;
  541.     long                            gReserved1;
  542.     long                            gReserved2;
  543.     long                            gReserved3;
  544.     long                            clientData;
  545.     RecordIDPtr                        userRecord;                    /*  --> OCE name(Record) of the user */
  546.     AuthKeyPtr                        userKey;                    /* <--  OCE Key for the user */
  547.     RStringPtr                        password;                    /*  --> Pointer to password string */
  548. };
  549. typedef struct AuthAddKeyPB AuthAddKeyPB;
  550.  
  551. /*
  552. kAuthChangeKey:
  553. userRecord will contain the user information whose identity has to be
  554. created. userKey will point to the key to be created. password points to
  555. an RString containing the password used to generate the key.
  556. */
  557. struct AuthChangeKeyPB {
  558.     Ptr                                qLink;
  559.     long                            reserved1;
  560.     long                            reserved2;
  561.     AuthIOCompletionUPP                ioCompletion;
  562.     OSErr                            ioResult;
  563.     unsigned long                    saveA5;
  564.     short                            reqCode;
  565.     long                            reserved[2];
  566.     AddrBlock                        serverHint;
  567.     short                            dsRefNum;
  568.     unsigned long                    callID;
  569.     AuthIdentity                    identity;
  570.     long                            gReserved1;
  571.     long                            gReserved2;
  572.     long                            gReserved3;
  573.     long                            clientData;
  574.     RecordIDPtr                        userRecord;                    /*  --> OCE name(Record) of the user */
  575.     AuthKeyPtr                        userKey;                    /* <--  New OCE Key for the user */
  576.     RStringPtr                        password;                    /*  -->Pointer to the new password string */
  577. };
  578. typedef struct AuthChangeKeyPB AuthChangeKeyPB;
  579.  
  580. /*
  581. AuthDeleteKey:
  582. userRecord will contain the user information whose Key has to be deleted.
  583. */
  584. struct AuthDeleteKeyPB {
  585.     Ptr                                qLink;
  586.     long                            reserved1;
  587.     long                            reserved2;
  588.     AuthIOCompletionUPP                ioCompletion;
  589.     OSErr                            ioResult;
  590.     unsigned long                    saveA5;
  591.     short                            reqCode;
  592.     long                            reserved[2];
  593.     AddrBlock                        serverHint;
  594.     short                            dsRefNum;
  595.     unsigned long                    callID;
  596.     AuthIdentity                    identity;
  597.     long                            gReserved1;
  598.     long                            gReserved2;
  599.     long                            gReserved3;
  600.     long                            clientData;
  601.     RecordIDPtr                        userRecord;                    /*  --> OCE name(Record) of the user */
  602. };
  603. typedef struct AuthDeleteKeyPB AuthDeleteKeyPB;
  604.  
  605. /* AuthPasswordToKey: Converts an RString into a key. */
  606. struct AuthPasswordToKeyPB {
  607.     Ptr                                qLink;
  608.     long                            reserved1;
  609.     long                            reserved2;
  610.     AuthIOCompletionUPP                ioCompletion;
  611.     OSErr                            ioResult;
  612.     unsigned long                    saveA5;
  613.     short                            reqCode;
  614.     long                            reserved[2];
  615.     AddrBlock                        serverHint;
  616.     short                            dsRefNum;
  617.     unsigned long                    callID;
  618.     AuthIdentity                    identity;
  619.     long                            gReserved1;
  620.     long                            gReserved2;
  621.     long                            gReserved3;
  622.     long                            clientData;
  623.     RecordIDPtr                        userRecord;                    /*  --> OCE name(Record) of the user */
  624.     AuthKeyPtr                        key;                        /* <--  */
  625.     RStringPtr                        password;                    /*  -->Pointer to the new password string */
  626. };
  627. typedef struct AuthPasswordToKeyPB AuthPasswordToKeyPB;
  628.  
  629. /*
  630. kAuthGetCredentials:
  631. userRecord will contain the user information whose identity has to be
  632. kMailDeletedMask. keyType (e.g. asDESKey) will indicate what type of key has to
  633. be deleted.
  634. */
  635. struct AuthGetCredentialsPB {
  636.     Ptr                                qLink;
  637.     long                            reserved1;
  638.     long                            reserved2;
  639.     AuthIOCompletionUPP                ioCompletion;
  640.     OSErr                            ioResult;
  641.     unsigned long                    saveA5;
  642.     short                            reqCode;
  643.     long                            reserved[2];
  644.     AddrBlock                        serverHint;
  645.     short                            dsRefNum;
  646.     unsigned long                    callID;
  647.     AuthIdentity                    identity;
  648.     long                            gReserved1;
  649.     long                            gReserved2;
  650.     long                            gReserved3;
  651.     long                            clientData;
  652.     AuthIdentity                    userIdentity;                /*  --> identity of initiator */
  653.     RecordIDPtr                        recipient;                    /*  --> OCE name of recipient */
  654.     AuthKeyPtr                        sessionKey;                    /* <--  session key */
  655.     UTCTime                            expiry;                        /* <--> desired/actual expiry */
  656.     unsigned long                    credentialsLength;            /* <--> max/actual credentials size */
  657.     Ptr                                credentials;                /* <--  buffer where credentials are returned */
  658. };
  659. typedef struct AuthGetCredentialsPB AuthGetCredentialsPB;
  660.  
  661. /*
  662. AuthDecryptCredentialsPB:
  663. Changes:
  664. userKey is changed userIdentity.
  665. userRecord is changed to initiatorRecord. User must supply buffer
  666. to hold initiatorRecord.
  667. agentList has changed to agent. There wil be no call back.
  668. User must supply buffer to hold agent Record.
  669. An additional boolean parameter 'hasAgent' is included.
  670. Toolbox will set this if an 'Agent' record is found in the
  671. credentials. If RecordIDPtr is 'nil', no agent record will
  672. be copied. However user can examine 'hasAgent', If true user
  673. can reissue this call with apprpriate buffer for getting a recordID.
  674. agent has changed to intermediary.  User must supply buffer to hold 
  675. intermediary Record.  The toolbox will set 'hasIntermediary' if an
  676. 'intermediary' record is found in the credentials. 
  677. */
  678. struct AuthDecryptCredentialsPB {
  679.     Ptr                                qLink;
  680.     long                            reserved1;
  681.     long                            reserved2;
  682.     AuthIOCompletionUPP                ioCompletion;
  683.     OSErr                            ioResult;
  684.     unsigned long                    saveA5;
  685.     short                            reqCode;
  686.     long                            reserved[2];
  687.     AddrBlock                        serverHint;
  688.     short                            dsRefNum;
  689.     unsigned long                    callID;
  690.     AuthIdentity                    identity;
  691.     long                            gReserved1;
  692.     long                            gReserved2;
  693.     long                            gReserved3;
  694.     long                            clientData;
  695.     AuthIdentity                    userIdentity;                /*  --> user's Identity */
  696.     RecordIDPtr                        initiatorRecord;            /* <--  OCE name of the initiator */
  697.     AuthKeyPtr                        sessionKey;                    /* <--  session key */
  698.     UTCTime                            expiry;                        /* <--  credentials expiry time */
  699.     unsigned long                    credentialsLength;            /*  --> actual credentials size */
  700.     Ptr                                credentials;                /*  --> credentials to be decrypted */
  701.     UTCTime                            issueTime;                    /* <--  credentials expiry time */
  702.     Boolean                            hasIntermediary;            /* <--  if true, An intermediary Record was found in credentials */
  703.     Boolean                            filler1;
  704.     RecordIDPtr                        intermediary;                /* <--  recordID of the intermediary */
  705. };
  706. typedef struct AuthDecryptCredentialsPB AuthDecryptCredentialsPB;
  707.  
  708. struct AuthMakeChallengePB {
  709.     Ptr                                qLink;
  710.     long                            reserved1;
  711.     long                            reserved2;
  712.     AuthIOCompletionUPP                ioCompletion;
  713.     OSErr                            ioResult;
  714.     unsigned long                    saveA5;
  715.     short                            reqCode;
  716.     long                            reserved[2];
  717.     AddrBlock                        serverHint;
  718.     short                            dsRefNum;
  719.     unsigned long                    callID;
  720.     AuthIdentity                    identity;
  721.     long                            gReserved1;
  722.     long                            gReserved2;
  723.     long                            gReserved3;
  724.     long                            clientData;
  725.     AuthKeyPtr                        key;                        /*  --> UnEncrypted SessionKey */
  726.     Ptr                                challenge;                    /* <--  Encrypted Challenge */
  727.     unsigned long                    challengeBufferLength;        /*  ->length of challenge buffer */
  728.     unsigned long                    challengeLength;            /*  <-length of Encrypted Challenge */
  729. };
  730. typedef struct AuthMakeChallengePB AuthMakeChallengePB;
  731.  
  732. struct AuthMakeReplyPB {
  733.     Ptr                                qLink;
  734.     long                            reserved1;
  735.     long                            reserved2;
  736.     AuthIOCompletionUPP                ioCompletion;
  737.     OSErr                            ioResult;
  738.     unsigned long                    saveA5;
  739.     short                            reqCode;
  740.     long                            reserved[2];
  741.     AddrBlock                        serverHint;
  742.     short                            dsRefNum;
  743.     unsigned long                    callID;
  744.     AuthIdentity                    identity;
  745.     long                            gReserved1;
  746.     long                            gReserved2;
  747.     long                            gReserved3;
  748.     long                            clientData;
  749.     AuthKeyPtr                        key;                        /*  --> UnEncrypted SessionKey */
  750.     Ptr                                challenge;                    /*  --> Encrypted Challenge */
  751.     Ptr                                reply;                        /* <--  Encrypted Reply */
  752.     unsigned long                    replyBufferLength;            /*  -->length of challenge buffer */
  753.     unsigned long                    challengeLength;            /*  --> length of Encrypted Challenge */
  754.     unsigned long                    replyLength;                /* <--  length of Encrypted Reply */
  755. };
  756. typedef struct AuthMakeReplyPB AuthMakeReplyPB;
  757.  
  758. struct AuthVerifyReplyPB {
  759.     Ptr                                qLink;
  760.     long                            reserved1;
  761.     long                            reserved2;
  762.     AuthIOCompletionUPP                ioCompletion;
  763.     OSErr                            ioResult;
  764.     unsigned long                    saveA5;
  765.     short                            reqCode;
  766.     long                            reserved[2];
  767.     AddrBlock                        serverHint;
  768.     short                            dsRefNum;
  769.     unsigned long                    callID;
  770.     AuthIdentity                    identity;
  771.     long                            gReserved1;
  772.     long                            gReserved2;
  773.     long                            gReserved3;
  774.     long                            clientData;
  775.     AuthKeyPtr                        key;                        /*  --> UnEncrypted SessionKey */
  776.     Ptr                                challenge;                    /*  --> Encrypted Challenge */
  777.     Ptr                                reply;                        /*  --> Encrypted Reply */
  778.     unsigned long                    challengeLength;            /*  --> length of Encrypted Challenge */
  779.     unsigned long                    replyLength;                /*  --> length of Encrypted Reply */
  780. };
  781. typedef struct AuthVerifyReplyPB AuthVerifyReplyPB;
  782.  
  783. /*
  784. kAuthGetUTCTime:
  785. RLI will contain a valid RLI for a cluster server.
  786. UTC(GMT) time from one of the cluster server will be returned.
  787. An 'offSet' from UTC(GMT) to Mac Local Time will also be returned.
  788. If RLI is nil Map DA is used to determine UTC(GMT).
  789. Mac Local Time = theUTCTime + theUTCOffset.
  790. */
  791. struct AuthGetUTCTimePB {
  792.     Ptr                                qLink;
  793.     long                            reserved1;
  794.     long                            reserved2;
  795.     AuthIOCompletionUPP                ioCompletion;
  796.     OSErr                            ioResult;
  797.     unsigned long                    saveA5;
  798.     short                            reqCode;
  799.     long                            reserved[2];
  800.     AddrBlock                        serverHint;
  801.     short                            dsRefNum;
  802.     unsigned long                    callID;
  803.     AuthIdentity                    identity;
  804.     long                            gReserved1;
  805.     long                            gReserved2;
  806.     long                            gReserved3;
  807.     long                            clientData;
  808.     PackedRLIPtr                    pRLI;                        /*  --> packed RLI of the Node, whose server's UTC is requested */
  809.     UTCTime                            theUTCTime;                    /* <--  current UTC(GMT) Time utc seconds since 1/1/1904 */
  810.     UTCOffset                        theUTCOffset;                /* <--  offset from UTC(GMT) seconds EAST of Greenwich */
  811. };
  812. typedef struct AuthGetUTCTimePB AuthGetUTCTimePB;
  813.  
  814. /*
  815. kAuthMakeProxy:
  816. A user represented bu the 'userIdentity' can make a proxy using this call.
  817. 'recipient' is the RecordID of the recipient whom user is requesting proxy.
  818. 'intermediary' is the RecordID of the intermediary holding proxy for the user.
  819. 'firstValid' is time at which proxy becomes valid.
  820. 'expiry' is the time at which proxy must expire.
  821. 'proxyLength' will have the length of the buffer pointed by 'proxy' as input.
  822. When the call completes, it will hold the actual length of proxy. If the
  823. call completes 'kOCEMoreData' error, client can reissue the call with the
  824. buffer size as 'proxyLength' returned.
  825. expiry is a suggestion, and may be adjusted to be earlier by the ADAP/OCE server.
  826. The 'proxy' obtained like this might be used by the 'intermediary' to obtain credentials
  827. for the server using TradeProxyForCredentials call.
  828. authDataLength and authData are intended for possible future work, but are
  829. ignored for now.
  830. */
  831. struct AuthMakeProxyPB {
  832.     Ptr                                qLink;
  833.     long                            reserved1;
  834.     long                            reserved2;
  835.     AuthIOCompletionUPP                ioCompletion;
  836.     OSErr                            ioResult;
  837.     unsigned long                    saveA5;
  838.     short                            reqCode;
  839.     long                            reserved[2];
  840.     AddrBlock                        serverHint;
  841.     short                            dsRefNum;
  842.     unsigned long                    callID;
  843.     AuthIdentity                    identity;
  844.     long                            gReserved1;
  845.     long                            gReserved2;
  846.     long                            gReserved3;
  847.     long                            clientData;
  848.     AuthIdentity                    userIdentity;                /*  --> identity of principal */
  849.     RecordIDPtr                        recipient;                    /*  --> OCE name of recipient */
  850.     UTCTime                            firstValid;                    /*  --> time at which proxy becomes valid */
  851.     UTCTime                            expiry;                        /*  --> time at which proxy expires */
  852.     unsigned long                    authDataLength;                /*  --> size of authorization data */
  853.     Ptr                                authData;                    /*  --> pointer to authorization data */
  854.     unsigned long                    proxyLength;                /* <--> max/actual proxy size */
  855.     Ptr                                proxy;                        /* <--> buffer where proxy is returned */
  856.     RecordIDPtr                        intermediary;                /*  --> RecordID of intermediary */
  857. };
  858. typedef struct AuthMakeProxyPB AuthMakeProxyPB;
  859.  
  860. /*
  861. kAuthTradeProxyForCredentials:
  862. Using this call, intermediary holding a 'proxy' for a recipient may obtain credentials
  863. for that recipient. 'userIdentity' is the identity for the 'intermediary'.
  864. 'recipient' is the RecordID for whom credetials are requested.
  865. 'principal' is the RecordID of the user who created the proxy.
  866. 'proxyLength' is the length of data pointed by 'proxy.
  867. If the call is succesfull, credentials will be returned in the
  868. buffer pointed by 'credentials'. 'expiry' is the desired expiry time at input.
  869. When call succeds this will have expiry time of credentials.
  870. This is very similar to GetCredentials except that we (of course) need the proxy,
  871. but we also need the name of the principal who created the proxy.
  872. */
  873. struct AuthTradeProxyForCredentialsPB {
  874.     Ptr                                qLink;
  875.     long                            reserved1;
  876.     long                            reserved2;
  877.     AuthIOCompletionUPP                ioCompletion;
  878.     OSErr                            ioResult;
  879.     unsigned long                    saveA5;
  880.     short                            reqCode;
  881.     long                            reserved[2];
  882.     AddrBlock                        serverHint;
  883.     short                            dsRefNum;
  884.     unsigned long                    callID;
  885.     AuthIdentity                    identity;
  886.     long                            gReserved1;
  887.     long                            gReserved2;
  888.     long                            gReserved3;
  889.     long                            clientData;
  890.     AuthIdentity                    userIdentity;                /*  --> identity of intermediary */
  891.     RecordIDPtr                        recipient;                    /*  --> OCE name of recipient */
  892.     AuthKeyPtr                        sessionKey;                    /* <--  session key */
  893.     UTCTime                            expiry;                        /* <--> desired/actual expiry */
  894.     unsigned long                    credentialsLength;            /* <--> max/actual credentials size */
  895.     Ptr                                credentials;                /* <--> buffer where credentials are returned */
  896.     unsigned long                    proxyLength;                /*  --> actual proxy size */
  897.     Ptr                                proxy;                        /*  --> buffer containing proxy */
  898.     RecordIDPtr                        principal;                    /*  --> RecordID of principal */
  899. };
  900. typedef struct AuthTradeProxyForCredentialsPB AuthTradeProxyForCredentialsPB;
  901.  
  902. /* API for Local Identity Interface */
  903. /*
  904. AuthGetLocalIdentityPB:
  905. A Collaborative application intended to work under the umbrella of LocalIdentity
  906. for the OCE toolbox will have to make this call to obtain LocalIdentity.
  907. If LocalIdentity has not been setup, then application will get
  908. 'kOCEOCESetupRequired.'. In this case application should put the dialog
  909. recommended by the OCE Setup document and guide the user through OCE Setup.
  910. If the OCESetup contains local identity, but user has not unlocked, it will get
  911. kOCELocalAuthenticationFail. In this case application should use SDPPromptForLocalIdentity
  912. to prompt user for the password.
  913. If a backGround application or stand alone code requires LocalIdentity, if it gets the
  914. OSErr from LocalIdentity and can not call SDPPromptForLocalIdentity, it should it self
  915. register with the toolbox using kAuthAddToLocalIdentityQueue call. It will be notified
  916. when a LocalIdentity gets created by a foreground application.
  917. */
  918. struct AuthGetLocalIdentityPB {
  919.     Ptr                                qLink;
  920.     long                            reserved1;
  921.     long                            reserved2;
  922.     AuthIOCompletionUPP                ioCompletion;
  923.     OSErr                            ioResult;
  924.     unsigned long                    saveA5;
  925.     short                            reqCode;
  926.     long                            reserved[2];
  927.     AddrBlock                        serverHint;
  928.     short                            dsRefNum;
  929.     unsigned long                    callID;
  930.     AuthIdentity                    identity;
  931.     long                            gReserved1;
  932.     long                            gReserved2;
  933.     long                            gReserved3;
  934.     long                            clientData;
  935.     LocalIdentity                    theLocalIdentity;            /* <--  LocalIdentity */
  936. };
  937. typedef struct AuthGetLocalIdentityPB AuthGetLocalIdentityPB;
  938.  
  939. /*
  940. kAuthUnlockLocalIdentity:
  941. The LocalIdentity can be created using this call.
  942. The userName and password correspond to the LocalIdentity setup.
  943. If the password matches, then collabIdentity will be returned.
  944. Typically SDPPromptForLocalIdentity call will make this call.
  945. All applications which are registered through kAuthAddToLocalIdentityQueue
  946. will be notified.
  947. */
  948. struct AuthUnlockLocalIdentityPB {
  949.     Ptr                                qLink;
  950.     long                            reserved1;
  951.     long                            reserved2;
  952.     AuthIOCompletionUPP                ioCompletion;
  953.     OSErr                            ioResult;
  954.     unsigned long                    saveA5;
  955.     short                            reqCode;
  956.     long                            reserved[2];
  957.     AddrBlock                        serverHint;
  958.     short                            dsRefNum;
  959.     unsigned long                    callID;
  960.     AuthIdentity                    identity;
  961.     long                            gReserved1;
  962.     long                            gReserved2;
  963.     long                            gReserved3;
  964.     long                            clientData;
  965.     LocalIdentity                    theLocalIdentity;            /* <--  LocalIdentity */
  966.     RStringPtr                        userName;                    /*  --> userName */
  967.     RStringPtr                        password;                    /*  -->user password */
  968. };
  969. typedef struct AuthUnlockLocalIdentityPB AuthUnlockLocalIdentityPB;
  970.  
  971. /*
  972. kAuthLockLocalIdentity:
  973. With this call existing LocalIdentity can be locked. If the ASDeleteLocalIdetity
  974. call fails with 'kOCEOperationDenied' error, name will contain the application which
  975. denied the operation. This name will be supplied by the application
  976. when it registered through kAuthAddToLocalIdentityQueue call
  977. */
  978. struct AuthLockLocalIdentityPB {
  979.     Ptr                                qLink;
  980.     long                            reserved1;
  981.     long                            reserved2;
  982.     AuthIOCompletionUPP                ioCompletion;
  983.     OSErr                            ioResult;
  984.     unsigned long                    saveA5;
  985.     short                            reqCode;
  986.     long                            reserved[2];
  987.     AddrBlock                        serverHint;
  988.     short                            dsRefNum;
  989.     unsigned long                    callID;
  990.     AuthIdentity                    identity;
  991.     long                            gReserved1;
  992.     long                            gReserved2;
  993.     long                            gReserved3;
  994.     long                            clientData;
  995.     LocalIdentity                    theLocalIdentity;            /*  --> LocalIdentity */
  996.     StringPtr                        name;                        /* <--  name of the app which denied delete */
  997. };
  998. typedef struct AuthLockLocalIdentityPB AuthLockLocalIdentityPB;
  999.  
  1000. typedef pascal Boolean (*NotificationProcPtr)(long clientData, AuthLocalIdentityOp callValue, AuthLocalIdentityLockAction actionValue, LocalIdentity identity);
  1001.  
  1002. #if GENERATINGCFM
  1003. typedef UniversalProcPtr NotificationUPP;
  1004. #else
  1005. typedef NotificationProcPtr NotificationUPP;
  1006. #endif
  1007.  
  1008. typedef NotificationUPP NotificationProc;
  1009.  
  1010. /*
  1011. kAuthAddToLocalIdentityQueue:
  1012. An application requiring notification of locking/unlocking of the
  1013. LocalIdentity can install itself using this call. The function provided
  1014. in 'notifyProc' will be called whenever the requested event happens.
  1015. When an AuthLockLocalIdentity call is made to the toolbox, the notificationProc
  1016. will be called with 'kAuthLockPending'. The application may refuse the lock by returning
  1017. a 'true' value. If all the registered entries return 'false' value, locking will be done
  1018. successfully. Otherwise 'kOCEOperationDenied' error is returned to the caller. The appName
  1019. (registered with the notificationProc) of the application which denied locking is also
  1020. returned to the caller making the AuthLockIdentity call.
  1021. */
  1022. struct AuthAddToLocalIdentityQueuePB {
  1023.     Ptr                                qLink;
  1024.     long                            reserved1;
  1025.     long                            reserved2;
  1026.     AuthIOCompletionUPP                ioCompletion;
  1027.     OSErr                            ioResult;
  1028.     unsigned long                    saveA5;
  1029.     short                            reqCode;
  1030.     long                            reserved[2];
  1031.     AddrBlock                        serverHint;
  1032.     short                            dsRefNum;
  1033.     unsigned long                    callID;
  1034.     AuthIdentity                    identity;
  1035.     long                            gReserved1;
  1036.     long                            gReserved2;
  1037.     long                            gReserved3;
  1038.     long                            clientData;
  1039.     NotificationUPP                    notifyProc;                    /*  --> notification procedure */
  1040.     AuthNotifications                notifyFlags;                /*  --> notifyFlags */
  1041.     StringPtr                        appName;                    /*  --> name of application to be returned in Delete/Stop */
  1042. };
  1043. typedef struct AuthAddToLocalIdentityQueuePB AuthAddToLocalIdentityQueuePB;
  1044.  
  1045. /*
  1046. kAuthRemoveFromLocalIdentityQueue:*/
  1047. struct AuthRemoveFromLocalIdentityQueuePB {
  1048.     Ptr                                qLink;
  1049.     long                            reserved1;
  1050.     long                            reserved2;
  1051.     AuthIOCompletionUPP                ioCompletion;
  1052.     OSErr                            ioResult;
  1053.     unsigned long                    saveA5;
  1054.     short                            reqCode;
  1055.     long                            reserved[2];
  1056.     AddrBlock                        serverHint;
  1057.     short                            dsRefNum;
  1058.     unsigned long                    callID;
  1059.     AuthIdentity                    identity;
  1060.     long                            gReserved1;
  1061.     long                            gReserved2;
  1062.     long                            gReserved3;
  1063.     long                            clientData;
  1064.     NotificationUPP                    notifyProc;                    /*  --> notification procedure */
  1065. };
  1066. typedef struct AuthRemoveFromLocalIdentityQueuePB AuthRemoveFromLocalIdentityQueuePB;
  1067.  
  1068. /*
  1069. kAuthSetupLocalIdentity:
  1070. The LocalIdentity can be Setup using this call.
  1071. The userName and password correspond to the LocalIdentity setup.
  1072. If a LocalIdentity Setup already exists 'kOCELocalIdentitySetupExists' error
  1073. will be returned.
  1074. */
  1075. struct AuthSetupLocalIdentityPB {
  1076.     Ptr                                qLink;
  1077.     long                            reserved1;
  1078.     long                            reserved2;
  1079.     AuthIOCompletionUPP                ioCompletion;
  1080.     OSErr                            ioResult;
  1081.     unsigned long                    saveA5;
  1082.     short                            reqCode;
  1083.     long                            reserved[2];
  1084.     AddrBlock                        serverHint;
  1085.     short                            dsRefNum;
  1086.     unsigned long                    callID;
  1087.     AuthIdentity                    identity;
  1088.     long                            gReserved1;
  1089.     long                            gReserved2;
  1090.     long                            gReserved3;
  1091.     long                            clientData;
  1092.     long                            aReserved;                    /*  --  */
  1093.     RStringPtr                        userName;                    /*  --> userName */
  1094.     RStringPtr                        password;                    /*  -->user password */
  1095. };
  1096. typedef struct AuthSetupLocalIdentityPB AuthSetupLocalIdentityPB;
  1097.  
  1098. /*
  1099. kAuthChangeLocalIdentity:
  1100. An existing LocalIdentity  Setup can be changed using this call.
  1101. The userName and password correspond to the LocalIdentity setup.
  1102. If a LocalIdentity Setup does not exists 'kOCEOCESetupRequired' error
  1103. will be returned. The user can use  kAuthSetupLocalIdentity call to setit up.
  1104. If the 'password' does not correspond to the existing setup, 'kOCELocalAuthenticationFail'
  1105. OSErr will be returned. If successful, LocalID will have new name as 'userName' and
  1106. password as 'newPassword' and if any applications has installed into 
  1107. LocalIdentityQueue with kNotifyNameChangeMask set, it will be notified with 
  1108. kAuthLocalIdentityNameChangeOp action value. 
  1109.  
  1110. */
  1111. struct AuthChangeLocalIdentityPB {
  1112.     Ptr                                qLink;
  1113.     long                            reserved1;
  1114.     long                            reserved2;
  1115.     AuthIOCompletionUPP                ioCompletion;
  1116.     OSErr                            ioResult;
  1117.     unsigned long                    saveA5;
  1118.     short                            reqCode;
  1119.     long                            reserved[2];
  1120.     AddrBlock                        serverHint;
  1121.     short                            dsRefNum;
  1122.     unsigned long                    callID;
  1123.     AuthIdentity                    identity;
  1124.     long                            gReserved1;
  1125.     long                            gReserved2;
  1126.     long                            gReserved3;
  1127.     long                            clientData;
  1128.     long                            aReserved;                    /*  --  */
  1129.     RStringPtr                        userName;                    /*  --> userName */
  1130.     RStringPtr                        password;                    /*  --> current password */
  1131.     RStringPtr                        newPassword;                /*  --> new password */
  1132. };
  1133. typedef struct AuthChangeLocalIdentityPB AuthChangeLocalIdentityPB;
  1134.  
  1135. /*
  1136. kAuthRemoveLocalIdentity:
  1137. An existing LocalIdentity  Setup can be removed using this call.
  1138. The userName and password correspond to the LocalIdentity setup.
  1139. If a LocalIdentity Setup does not exists 'kOCEOCESetupRequired' error
  1140. will be returned.
  1141. If the 'password' does not correspond to the existing setup, 'kOCELocalAuthenticationFail'
  1142. OSErr will be returned. If successful, LocalIdentity will be removed from the OCE Setup.
  1143. This is a very distructive operation, user must be warned enough before actually making
  1144. this call.
  1145. */
  1146. struct AuthRemoveLocalIdentityPB {
  1147.     Ptr                                qLink;
  1148.     long                            reserved1;
  1149.     long                            reserved2;
  1150.     AuthIOCompletionUPP                ioCompletion;
  1151.     OSErr                            ioResult;
  1152.     unsigned long                    saveA5;
  1153.     short                            reqCode;
  1154.     long                            reserved[2];
  1155.     AddrBlock                        serverHint;
  1156.     short                            dsRefNum;
  1157.     unsigned long                    callID;
  1158.     AuthIdentity                    identity;
  1159.     long                            gReserved1;
  1160.     long                            gReserved2;
  1161.     long                            gReserved3;
  1162.     long                            clientData;
  1163.     long                            aReserved;                    /*  --  */
  1164.     RStringPtr                        userName;                    /*  --> userName */
  1165.     RStringPtr                        password;                    /*  --> current password */
  1166. };
  1167. typedef struct AuthRemoveLocalIdentityPB AuthRemoveLocalIdentityPB;
  1168.  
  1169. /*
  1170. kOCESetupAddDirectoryInfo:
  1171. Using this call identity for a catalog can be setup under LocalIdentity umbrella.
  1172. ASCreateLocalIdentity should have been done succesfully before making this call.
  1173. directoryRecordCID -> is the record creationID obtained when DirAddOCEDirectory or
  1174. DirAddDSAMDirectory call was made.
  1175. rid-> is the recordID in which the identity for the catalog will be established.
  1176. password-> the password associated with the rid in the catalog world.
  1177. */
  1178. struct OCESetupAddDirectoryInfoPB {
  1179.     Ptr                                qLink;
  1180.     long                            reserved1;
  1181.     long                            reserved2;
  1182.     AuthIOCompletionUPP                ioCompletion;
  1183.     OSErr                            ioResult;
  1184.     unsigned long                    saveA5;
  1185.     short                            reqCode;
  1186.     long                            reserved[2];
  1187.     AddrBlock                        serverHint;
  1188.     short                            dsRefNum;
  1189.     unsigned long                    callID;
  1190.     AuthIdentity                    identity;
  1191.     long                            gReserved1;
  1192.     long                            gReserved2;
  1193.     long                            gReserved3;
  1194.     long                            clientData;
  1195.     CreationID                        directoryRecordCID;            /*  --> CreationID for the catalog */
  1196.     RecordIDPtr                        recordID;                    /*  --> recordID for the identity */
  1197.     RStringPtr                        password;                    /*  --> password in the catalog world */
  1198. };
  1199. typedef struct OCESetupAddDirectoryInfoPB OCESetupAddDirectoryInfoPB;
  1200.  
  1201. /*
  1202. kOCESetupChangeDirectoryInfo:
  1203. Using this call an existing identity for a catalog under LocalIdentity umbrella
  1204. can be changed.
  1205. ASCreateLocalIdentity should have been done succesfully before making this call.
  1206. directoryRecordCID -> is the record creationID obtained when DirAddOCEDirectory or
  1207. DirAddDSAMDirectory call was made.
  1208. rid-> is the recordID in which the identity for the catalog will be established.
  1209. password-> the password associated with the rid in the catalog world.
  1210. newPassword -> the new password for the catalog
  1211. */
  1212. struct OCESetupChangeDirectoryInfoPB {
  1213.     Ptr                                qLink;
  1214.     long                            reserved1;
  1215.     long                            reserved2;
  1216.     AuthIOCompletionUPP                ioCompletion;
  1217.     OSErr                            ioResult;
  1218.     unsigned long                    saveA5;
  1219.     short                            reqCode;
  1220.     long                            reserved[2];
  1221.     AddrBlock                        serverHint;
  1222.     short                            dsRefNum;
  1223.     unsigned long                    callID;
  1224.     AuthIdentity                    identity;
  1225.     long                            gReserved1;
  1226.     long                            gReserved2;
  1227.     long                            gReserved3;
  1228.     long                            clientData;
  1229.     CreationID                        directoryRecordCID;            /*  --> CreationID for the catalog */
  1230.     RecordIDPtr                        recordID;                    /*  --> recordID for the identity */
  1231.     RStringPtr                        password;                    /*  --> password in the catalog world */
  1232.     RStringPtr                        newPassword;                /*  --> new password in the catalog */
  1233. };
  1234. typedef struct OCESetupChangeDirectoryInfoPB OCESetupChangeDirectoryInfoPB;
  1235.  
  1236. /*
  1237. kOCESetupRemoveDirectoryInfo:
  1238. Using this call an existing identity for a catalog under LocalIdentity umbrella
  1239. can be changed.
  1240. ASCreateLocalIdentity should have been done succesfully before making this call.
  1241. directoryRecordCID -> is the record creationID obtained when DirAddOCEDirectory or
  1242. */
  1243. struct OCESetupRemoveDirectoryInfoPB {
  1244.     Ptr                                qLink;
  1245.     long                            reserved1;
  1246.     long                            reserved2;
  1247.     AuthIOCompletionUPP                ioCompletion;
  1248.     OSErr                            ioResult;
  1249.     unsigned long                    saveA5;
  1250.     short                            reqCode;
  1251.     long                            reserved[2];
  1252.     AddrBlock                        serverHint;
  1253.     short                            dsRefNum;
  1254.     unsigned long                    callID;
  1255.     AuthIdentity                    identity;
  1256.     long                            gReserved1;
  1257.     long                            gReserved2;
  1258.     long                            gReserved3;
  1259.     long                            clientData;
  1260.     CreationID                        directoryRecordCID;            /*  --> CreationID for the catalog */
  1261. };
  1262. typedef struct OCESetupRemoveDirectoryInfoPB OCESetupRemoveDirectoryInfoPB;
  1263.  
  1264. /*
  1265. kOCESetupGetDirectoryInfo:
  1266. Using this call info on an existing identity for a particular catalog under LocalIdentity umbrella
  1267. can be obtained.
  1268. For the specified catalog 'directoryName' and 'discriminator', rid and nativeName will
  1269. returned. Caller must provide appropriate buffer to get back rid and nativeName.
  1270. 'password' will be returned  for  non-ADAP Catalogs.
  1271. */
  1272. struct OCESetupGetDirectoryInfoPB {
  1273.     Ptr                                qLink;
  1274.     long                            reserved1;
  1275.     long                            reserved2;
  1276.     AuthIOCompletionUPP                ioCompletion;
  1277.     OSErr                            ioResult;
  1278.     unsigned long                    saveA5;
  1279.     short                            reqCode;
  1280.     long                            reserved[2];
  1281.     AddrBlock                        serverHint;
  1282.     short                            dsRefNum;
  1283.     unsigned long                    callID;
  1284.     AuthIdentity                    identity;
  1285.     long                            gReserved1;
  1286.     long                            gReserved2;
  1287.     long                            gReserved3;
  1288.     long                            clientData;
  1289.     DirectoryNamePtr                directoryName;                /*  --> catalog name */
  1290.     DirDiscriminator                discriminator;                /*  --> discriminator for the catalog */
  1291.     RecordIDPtr                        recordID;                    /* <--  rid for the catalog identity */
  1292.     RStringPtr                        nativeName;                    /* <--  user name in the catalog world */
  1293.     RStringPtr                        password;                    /* <--  password in the catalog world */
  1294. };
  1295. typedef struct OCESetupGetDirectoryInfoPB OCESetupGetDirectoryInfoPB;
  1296.  
  1297. /*****************************************************************************
  1298.  
  1299.  
  1300.          Catalog Manager operations
  1301.  
  1302.  
  1303. *****************************************************************************/
  1304. typedef union DirParamBlock DirParamBlock;
  1305.  
  1306. typedef DirParamBlock *DirParamBlockPtr;
  1307.  
  1308. typedef pascal void (*DirIOCompletionProcPtr)(DirParamBlockPtr paramBlock);
  1309.  
  1310. #if GENERATINGCFM
  1311. typedef UniversalProcPtr DirIOCompletionUPP;
  1312. #else
  1313. typedef DirIOCompletionProcPtr DirIOCompletionUPP;
  1314. #endif
  1315.  
  1316. #define DirParamHeader             \
  1317.     Ptr    qLink;                        \
  1318.     long    reserved1;                \
  1319.     long    reserved2;                \
  1320.     DirIOCompletionUPP    ioCompletion;     \
  1321.     OSErr    ioResult;                \
  1322.     unsigned long    saveA5;            \
  1323.     short    reqCode;                    \
  1324.     long    reserved[2];                \
  1325.     AddrBlock    serverHint;            \
  1326.     short    dsRefNum;                \
  1327.     unsigned long    callID;            \
  1328.     AuthIdentity    identity;            \
  1329.     long    gReserved1;                \
  1330.     long    gReserved2;                \
  1331.     long    gReserved3;                \
  1332.     long    clientData;
  1333. struct DirAddRecordPB {
  1334.     Ptr                                qLink;
  1335.     long                            reserved1;
  1336.     long                            reserved2;
  1337.     DirIOCompletionUPP                ioCompletion;
  1338.     OSErr                            ioResult;
  1339.     unsigned long                    saveA5;
  1340.     short                            reqCode;
  1341.     long                            reserved[2];
  1342.     AddrBlock                        serverHint;
  1343.     short                            dsRefNum;
  1344.     unsigned long                    callID;
  1345.     AuthIdentity                    identity;
  1346.     long                            gReserved1;
  1347.     long                            gReserved2;
  1348.     long                            gReserved3;
  1349.     long                            clientData;
  1350.     RecordIDPtr                        aRecord;                    /*  --> CreationID returned here */
  1351.     Boolean                            allowDuplicate;                /*  --> */
  1352.     Boolean                            filler1;
  1353. };
  1354. typedef struct DirAddRecordPB DirAddRecordPB;
  1355.  
  1356. /* DeleteRecord */
  1357. struct DirDeleteRecordPB {
  1358.     Ptr                                qLink;
  1359.     long                            reserved1;
  1360.     long                            reserved2;
  1361.     DirIOCompletionUPP                ioCompletion;
  1362.     OSErr                            ioResult;
  1363.     unsigned long                    saveA5;
  1364.     short                            reqCode;
  1365.     long                            reserved[2];
  1366.     AddrBlock                        serverHint;
  1367.     short                            dsRefNum;
  1368.     unsigned long                    callID;
  1369.     AuthIdentity                    identity;
  1370.     long                            gReserved1;
  1371.     long                            gReserved2;
  1372.     long                            gReserved3;
  1373.     long                            clientData;
  1374.     RecordIDPtr                        aRecord;                    /*  --> */
  1375. };
  1376. typedef struct DirDeleteRecordPB DirDeleteRecordPB;
  1377.  
  1378. /* aRecord must contain valid PackedRLI and a CreationID. */
  1379. /**********************************************************************************/
  1380. /*
  1381. DirEnumerate:
  1382. This call can be used to enumerate both DNodes and records under a specified
  1383. DNode. A DNode is specified by the PackedRLIPtr 'aRLI'.
  1384.  
  1385. startingPoint indicates where to start the enumeration.  Initially,
  1386. it should be set to a value of nil.  After some records are enumerated,
  1387. the client can issue the call again with the same aRLI and recordName and
  1388. typeList. The last received DirEnumSpec in the startingPoint field.  The server
  1389. will continue the enumeration from that record on. if user wants to get back the
  1390. value specified in the startingRecord also, the Boolean 'includeStartingPoint'
  1391. must be set to 'true'. If this is set to 'false', records specified after the
  1392. startingPoint record will be returned.
  1393.  
  1394. sortBy indicates to the server to return the records that match in name-first
  1395. or type-first order.  sortDirection indicates to the server to search in forward
  1396. or backward sort order for RecordIDs Specified.
  1397.  
  1398. RecordIDS and Enumeration Criteria:
  1399.  
  1400. PackedRLIPtr parameter 'aRLI' will be accepted for DNode
  1401. specification.
  1402.  
  1403. One RStringPtr 'nameMatchString' is provided. User is allowed to
  1404. specify a wild card in the name. WildCard specification is specified in 
  1405. matchNameHow parameter and possible values are defined in DirMatchWith Enum.
  1406.  
  1407. 'typeCount' parameter indicate how many types are in the 'typeList'.
  1408.  
  1409. 'typeList' parmeter is a pointer to an RString array of size 'typeCount'.
  1410.  
  1411. If 'typeCount' is exactly equal to one, a wild card can be specified
  1412. for the entity type; otherwise types have to be completely specified.
  1413. WildCard specification is specified in  matchNameHow parameter
  1414.  and possible values are defined in DirMatchWith Enum.
  1415.  
  1416.  
  1417. A nil value for 'startingPoint' is allowed when sortDirection specified
  1418. is 'kSortBackwards'. This was not allowed previously.
  1419.  
  1420. 'enumFlags' parameter is a bit field. The following bits can be set:
  1421.     kEnumDistinguishedNameMask to get back records in the cluster data base.
  1422.     kEnumAliasMask to get back record aliases
  1423.     kEnumPseudonymMask to get back record pseudonyms
  1424.     kEnumDNodeMask to get back any children dNodes for the DNode specified in the
  1425.     'aRLI' parameter.
  1426.     kEnumForeignDNodeMask to get back any children dNodes which have ForeignDnodes in the
  1427.     dNode specified in the 'aRLI' parameter.
  1428.  
  1429.     kEnumAll is combination of all five values and can be used to enumerate
  1430.     everything under a specified DNode.
  1431.  
  1432.  
  1433.  
  1434. The results returned for each element will consist of a DirEnumSpec.
  1435. The DirEnumSpec contains 'enumFlag' which indicates the type of entity and a
  1436. union which will have either DNodeID or LocalRecordID depending on the value of 'enumFlag'.
  1437. The 'enumFlag'  will indicate whether the returned element is a
  1438. record(kEnumDistinguishedNameMask bit) or a alias(kEnumAliasMask bit) or a
  1439. Pseudonym(kEnumPseudonymMask) or a child DNode(kEnumDNodeMask bit).  If the 'enumFlag' value
  1440. is kEnumDnodeMask, it indicates the value returned in the union is a DNodeID (i.e. 'dNodeNumber'
  1441. is the 'dNodeNumber' of the child dnode(if the catalog supports dNodeNumbers, otherwise
  1442. this will be set to zero). The name will be the child dnode name. For other values of the
  1443. 'enumFlag', the value in the union will be LocalRecordID. In addition to kEnumDnodeMask it is
  1444. possible that kEnumForeignDNodeMask is also set. This is an advisory bit and application must make
  1445. it's own decision before displaying these records. If catalog supports kSupportIndexRatioMask, it
  1446. may also return the relative position of the record (percentile of total records) in the 
  1447. indexRatio field in EnumSpec.
  1448.  
  1449.  
  1450. responseSLRV will contain the script, language, region and version of the oce sorting software.
  1451. The results will be collected in the 'getBuffer' supplied by the user.
  1452. If buffer can not hold all the data returned 'kOCEMoreData' error will be returned.
  1453.  
  1454. If user receives 'noErr' or 'kOCEMoreData', buffer will contain valid results. A user
  1455. can extract the results in the 'getBuffer' by making DirEnumerateParse' call.
  1456. */
  1457. struct DirEnumerateGetPB {
  1458.     Ptr                                qLink;
  1459.     long                            reserved1;
  1460.     long                            reserved2;
  1461.     DirIOCompletionUPP                ioCompletion;
  1462.     OSErr                            ioResult;
  1463.     unsigned long                    saveA5;
  1464.     short                            reqCode;
  1465.     long                            reserved[2];
  1466.     AddrBlock                        serverHint;
  1467.     short                            dsRefNum;
  1468.     unsigned long                    callID;
  1469.     AuthIdentity                    identity;
  1470.     long                            gReserved1;
  1471.     long                            gReserved2;
  1472.     long                            gReserved3;
  1473.     long                            clientData;
  1474.     PackedRLIPtr                    aRLI;                        /*  --> an RLI specifying the cluster to be enumerated */
  1475.     DirEnumSpec                        *startingPoint;                /*  --> */
  1476.     DirSortOption                    sortBy;                        /*  --> */
  1477.     DirSortDirection                sortDirection;                /*  --> */
  1478.     long                            dReserved;                    /*  --  */
  1479.     RStringPtr                        nameMatchString;            /*  --> name from which enumeration should start */
  1480.     RStringPtr                        *typesList;                    /*  --> list of entity types to be enumerated */
  1481.     unsigned long                    typeCount;                    /*  --> number of types in the list */
  1482.     DirEnumChoices                    enumFlags;                    /*  --> indicates what to enumerate */
  1483.     Boolean                            includeStartingPoint;        /*  --> if true return the record specified in starting point */
  1484.     Byte                            padByte;
  1485.     DirMatchWith                    matchNameHow;                /*  --> Matching Criteria for nameMatchString */
  1486.     DirMatchWith                    matchTypeHow;                /*  --> Matching Criteria for typeList */
  1487.     Ptr                                getBuffer;                    /*  --> */
  1488.     unsigned long                    getBufferSize;                /*  --> */
  1489.     SLRV                            responseSLRV;                /*  <--  response SLRV */
  1490. };
  1491. typedef struct DirEnumerateGetPB DirEnumerateGetPB;
  1492.  
  1493. /* The EnumerateRecords call-back function is defined as follows: */
  1494. typedef pascal Boolean (*ForEachDirEnumSpecProcPtr)(long clientData, const DirEnumSpec *enumSpec);
  1495.  
  1496. #if GENERATINGCFM
  1497. typedef UniversalProcPtr ForEachDirEnumSpecUPP;
  1498. #else
  1499. typedef ForEachDirEnumSpecProcPtr ForEachDirEnumSpecUPP;
  1500. #endif
  1501.  
  1502. typedef ForEachDirEnumSpecUPP ForEachDirEnumSpec;
  1503.  
  1504. /*
  1505. EnumerateParse:
  1506. After an EnumerateGet call has completed, call EnumerateParse
  1507. to parse through the buffer that was filled in EnumerateGet.
  1508.  
  1509. 'eachEnumSpec' will be called each time to return to the client a
  1510. DirEnumSpec that matches the pattern for enumeration. 'enumFlag' indicates the type
  1511. of information returned in the DirEnumSpec
  1512. The clientData parameter that you pass in the parameter block will be passed
  1513. to 'forEachEnumDSSpecFunc'.  You are free to put anything in clientData - it is intended
  1514. to allow you some way to match the call-back to the original call (for
  1515. example, you make more then one aysynchronous EnumerateGet calls and you want to
  1516. associate returned results in some way).
  1517.  
  1518. The client should return FALSE from 'eachEnumSpec' to continue
  1519. processing of the EnumerateParse request.  Returning TRUE will
  1520. terminate the EnumerateParse request.
  1521.  
  1522. For synchronous calls, the call-back routine actually runs as part of the same thread
  1523. of execution as the thread that made the EnumerateParse call.  That means that the
  1524. same low-memory globals, A5, stack, etc. are in effect during the call-back
  1525. that were in effect when the call was made.  Because of this, the call-back
  1526. routine has the same restrictions as the caller of EnumerateParse:
  1527. if EnumerateParse was not called from interrupt level, then the call-
  1528. back routine can allocate memory. For asynchronous calls, call-back routine is
  1529. like a ioCompletion except that A5 will be preserved for the application.
  1530. */
  1531. struct DirEnumerateParsePB {
  1532.     Ptr                                qLink;
  1533.     long                            reserved1;
  1534.     long                            reserved2;
  1535.     DirIOCompletionUPP                ioCompletion;
  1536.     OSErr                            ioResult;
  1537.     unsigned long                    saveA5;
  1538.     short                            reqCode;
  1539.     long                            reserved[2];
  1540.     AddrBlock                        serverHint;
  1541.     short                            dsRefNum;
  1542.     unsigned long                    callID;
  1543.     AuthIdentity                    identity;
  1544.     long                            gReserved1;
  1545.     long                            gReserved2;
  1546.     long                            gReserved3;
  1547.     long                            clientData;
  1548.     PackedRLIPtr                    aRLI;                        /*  --> an RLI specifying the cluster to be enumerated */
  1549.     long                            bReserved;                    /*  --  */
  1550.     long                            cReserved;                    /*  --  */
  1551.     ForEachDirEnumSpec                eachEnumSpec;                /*  --> */
  1552.     long                            eReserved;                    /*  --  */
  1553.     long                            fReserved;                    /*  --  */
  1554.     long                            gReserved;                    /*  --  */
  1555.     long                            hReserved;                    /*  --  */
  1556.     long                            iReserved;                    /*  --  */
  1557.     Ptr                                getBuffer;                    /*  --> */
  1558.     unsigned long                    getBufferSize;                /*  --> */
  1559.     short                            l1Reserved;                    /*  -- */
  1560.     short                            l2Reserved;                    /*  --  */
  1561.     short                            l3Reserved;                    /*  -- */
  1562.     short                            l4Reserved;                    /*  --  */
  1563. };
  1564. typedef struct DirEnumerateParsePB DirEnumerateParsePB;
  1565.  
  1566. /*
  1567.  * FindRecordGet operates similarly to DirEnumerate except it returns a list
  1568.  * of records instead of records local to a cluster.
  1569. */
  1570. struct DirFindRecordGetPB {
  1571.     Ptr                                qLink;
  1572.     long                            reserved1;
  1573.     long                            reserved2;
  1574.     DirIOCompletionUPP                ioCompletion;
  1575.     OSErr                            ioResult;
  1576.     unsigned long                    saveA5;
  1577.     short                            reqCode;
  1578.     long                            reserved[2];
  1579.     AddrBlock                        serverHint;
  1580.     short                            dsRefNum;
  1581.     unsigned long                    callID;
  1582.     AuthIdentity                    identity;
  1583.     long                            gReserved1;
  1584.     long                            gReserved2;
  1585.     long                            gReserved3;
  1586.     long                            clientData;
  1587.     RecordIDPtr                        startingPoint;
  1588.     long                            reservedA[2];
  1589.     RStringPtr                        nameMatchString;
  1590.     RStringPtr                        *typesList;
  1591.     unsigned long                    typeCount;
  1592.     long                            reservedB;
  1593.     short                            reservedC;
  1594.     DirMatchWith                    matchNameHow;
  1595.     DirMatchWith                    matchTypeHow;
  1596.     Ptr                                getBuffer;
  1597.     unsigned long                    getBufferSize;
  1598.     DirectoryNamePtr                directoryName;
  1599.     DirDiscriminator                discriminator;
  1600. };
  1601. typedef struct DirFindRecordGetPB DirFindRecordGetPB;
  1602.  
  1603. /* The FindRecordParse call-back function is defined as follows: */
  1604. typedef pascal Boolean (*ForEachRecordProcPtr)(long clientData, const DirEnumSpec *enumSpec, PackedRLIPtr pRLI);
  1605.  
  1606. #if GENERATINGCFM
  1607. typedef UniversalProcPtr ForEachRecordUPP;
  1608. #else
  1609. typedef ForEachRecordProcPtr ForEachRecordUPP;
  1610. #endif
  1611.  
  1612. typedef ForEachRecordUPP ForEachRecord;
  1613.  
  1614. /*
  1615.  * This PB same as DirFindRecordGet except it includes the callback function
  1616. */
  1617. struct DirFindRecordParsePB {
  1618.     Ptr                                qLink;
  1619.     long                            reserved1;
  1620.     long                            reserved2;
  1621.     DirIOCompletionUPP                ioCompletion;
  1622.     OSErr                            ioResult;
  1623.     unsigned long                    saveA5;
  1624.     short                            reqCode;
  1625.     long                            reserved[2];
  1626.     AddrBlock                        serverHint;
  1627.     short                            dsRefNum;
  1628.     unsigned long                    callID;
  1629.     AuthIdentity                    identity;
  1630.     long                            gReserved1;
  1631.     long                            gReserved2;
  1632.     long                            gReserved3;
  1633.     long                            clientData;
  1634.     RecordIDPtr                        startingPoint;
  1635.     long                            reservedA[2];
  1636.     RStringPtr                        nameMatchString;
  1637.     RStringPtr                        *typesList;
  1638.     unsigned long                    typeCount;
  1639.     long                            reservedB;
  1640.     short                            reservedC;
  1641.     DirMatchWith                    matchNameHow;
  1642.     DirMatchWith                    matchTypeHow;
  1643.     Ptr                                getBuffer;
  1644.     unsigned long                    getBufferSize;
  1645.     DirectoryNamePtr                directoryName;
  1646.     DirDiscriminator                discriminator;
  1647.     ForEachRecord                    forEachRecordFunc;
  1648. };
  1649. typedef struct DirFindRecordParsePB DirFindRecordParsePB;
  1650.  
  1651. /*
  1652. LookupGet:
  1653.  
  1654. aRecordList is an array of pointers to RecordIDs, each of which must
  1655. contain valid PackedRLI and a CreationID.  recordIDCount is
  1656. the size of this array.
  1657.  
  1658. attrTypeList is an array of pointers to AttributeTypes.  attrTypeCount is
  1659. the size of this array.
  1660.  
  1661. staringRecordIndex is the record from which to continue the lookup.
  1662. If you want to start from first record in the list, this must be 1 (not zero).
  1663. This value must always be <= recordIDCount.
  1664.  
  1665. startingAttributeIndex is the AttributeType from which we want to continue the lookup.
  1666. If you want to start from first attribute in the list, this must be 1 (not zero).
  1667. This value must always be <= attrTypeCount.
  1668.  
  1669. startingAttribute is the value of the attribute value from which we want to
  1670. continue lookup. In case of catalogs supporting creationIDs, startingAttribute
  1671. may contain only a CID. Other catalogs may require the entire value.
  1672. If a non-null cid is given and if an attribute value with that cid is not found, this
  1673. call will terminate with kOCENoSuchAttribute error. A client should not make a LookupParse call
  1674. after getting this error.
  1675.  
  1676. 'includeStartingPoint' boolean can be set to 'true' to receive the value specified in the
  1677. startingPoint in the results returned. If this is set to 'false', the value
  1678. specified in the startingAttribute will not be returned.
  1679.  
  1680. When LookupGet call fails with kOCEMoreData, the client will be able to find out where the call ended
  1681. with a subsequent LookupParse call. When the LookupParse call completes with kOCEMoreData,
  1682. lastRecordIndex, lastAttributeIndex and lastValueCID will point to the corresponding
  1683. recordID, attributeType and the CreationID of the last value returned successfully. These parameters
  1684. are exactly the same ones for the startingRecordIndex, startingAttributeIndex, and startingAttrValueCID
  1685. so they can be used in a subsequent LookupGet call to continue the lookup.
  1686.  
  1687. In an extreme case, It is possible that we had an attribute value that is too large to fit
  1688. in the client's buffer. In such cases, if it was the only thing that we tried to fit
  1689. into the buffer, the client will not able to proceed further because he will not know the
  1690. attributeCID of the attribute to continue with.  Also he does not know how big a buffer
  1691. would be needed for the next call to get this 'mondo' attribute value successfully.
  1692.  
  1693. to support this, LookupParse call will do the following:
  1694.  
  1695. If LookupGet has failed with kOCEMoreData error, LookupParse will check to make sure that
  1696. ForEachAttributeValueFunc has been called at least once. If so, the client has the option
  1697. to continue from that attribute CreationID (for PAB/ADAP) in the next LookupGet call.
  1698. However, if it was not even called once, then the attribute value may be too big to fit in the
  1699. user's buffer. In this case, lastAttrValueCID (lastAttribute) and attrSize are returned in the
  1700. parse buffer and the call will fail with kOCEMoreAttrValue. However, it is possible that
  1701. ForEachAttributeValue was not called because the user does not have read access to some of
  1702. the attributeTypes in the list, and the buffer was full before even reading the creationID of
  1703. any of the attribute values.  A kOCEMoreData error is returned.
  1704.  
  1705. The Toolbox will check for duplicate RecordIDs in the aRecordList. If found, it will return
  1706. 'daDuplicateRecordIDErr'.
  1707.  
  1708. The Toolbox will check for duplicate AttributeTypes in the attrTypeList. If found it will
  1709. return 'daDuplicateAttrTypeErr'.
  1710. */
  1711. struct DirLookupGetPB {
  1712.     Ptr                                qLink;
  1713.     long                            reserved1;
  1714.     long                            reserved2;
  1715.     DirIOCompletionUPP                ioCompletion;
  1716.     OSErr                            ioResult;
  1717.     unsigned long                    saveA5;
  1718.     short                            reqCode;
  1719.     long                            reserved[2];
  1720.     AddrBlock                        serverHint;
  1721.     short                            dsRefNum;
  1722.     unsigned long                    callID;
  1723.     AuthIdentity                    identity;
  1724.     long                            gReserved1;
  1725.     long                            gReserved2;
  1726.     long                            gReserved3;
  1727.     long                            clientData;
  1728.     RecordIDPtr                        *aRecordList;                /*  --> an array of RecordID pointers */
  1729.     AttributeTypePtr                *attrTypeList;                /*  --> an array of attribute types */
  1730.     long                            cReserved;                    /*  --  */
  1731.     long                            dReserved;                    /*  --  */
  1732.     long                            eReserved;                    /*  --  */
  1733.     long                            fReserved;                    /*  --  */
  1734.     unsigned long                    recordIDCount;                /*  --> */
  1735.     unsigned long                    attrTypeCount;                /*  --> */
  1736.     Boolean                            includeStartingPoint;        /*  --> if true return the value specified by the starting indices */
  1737.     Byte                            padByte;
  1738.     short                            i1Reserved;                    /*  --  */
  1739.     Ptr                                getBuffer;                    /*  --> */
  1740.     unsigned long                    getBufferSize;                /*  --> */
  1741.     unsigned long                    startingRecordIndex;        /*  --> start from this record */
  1742.     unsigned long                    startingAttrTypeIndex;        /*  --> start from this attribute type */
  1743.     Attribute                        startingAttribute;            /*  --> start from this attribute value */
  1744.     long                            pReserved;                    /*  --  */
  1745. };
  1746. typedef struct DirLookupGetPB DirLookupGetPB;
  1747.  
  1748. /* The Lookup call-back functions are defined as follows: */
  1749. typedef pascal Boolean (*ForEachLookupRecordIDProcPtr)(long clientData, const RecordID *recordID);
  1750.  
  1751. #if GENERATINGCFM
  1752. typedef UniversalProcPtr ForEachLookupRecordIDUPP;
  1753. #else
  1754. typedef ForEachLookupRecordIDProcPtr ForEachLookupRecordIDUPP;
  1755. #endif
  1756.  
  1757. typedef ForEachLookupRecordIDUPP ForEachLookupRecordID;
  1758.  
  1759. typedef pascal Boolean (*ForEachAttrTypeLookupProcPtr)(long clientData, const AttributeType *attrType, AccessMask myAttrAccMask);
  1760.  
  1761. #if GENERATINGCFM
  1762. typedef UniversalProcPtr ForEachAttrTypeLookupUPP;
  1763. #else
  1764. typedef ForEachAttrTypeLookupProcPtr ForEachAttrTypeLookupUPP;
  1765. #endif
  1766.  
  1767. typedef ForEachAttrTypeLookupUPP ForEachAttrTypeLookup;
  1768.  
  1769. typedef pascal Boolean (*ForEachAttrValueProcPtr)(long clientData, const Attribute *attribute);
  1770.  
  1771. #if GENERATINGCFM
  1772. typedef UniversalProcPtr ForEachAttrValueUPP;
  1773. #else
  1774. typedef ForEachAttrValueProcPtr ForEachAttrValueUPP;
  1775. #endif
  1776.  
  1777. typedef ForEachAttrValueUPP ForEachAttrValue;
  1778.  
  1779. /*
  1780. LookupParse:
  1781.  
  1782. After a LookupGet call has completed, call LookupParse
  1783. to parse through the buffer that was filled in LookupGet.  The
  1784. toolbox will parse through the buffer and call the appropriate call-back routines
  1785. for each item in the getBuffer.
  1786.  
  1787. 'eachRecordID' will be called each time to return to the client one of the
  1788. RecordIDs from aRecordList.  The clientData parameter that you
  1789. pass in the parameter block will be passed to eachRecordID.
  1790. You are free to put anything in clientData - it is intended to allow
  1791. you some way to match the call-back to the original call (in case, for
  1792. example, you make simultaneous asynchronous LookupGet calls).  If you don't
  1793. want to get a call-back for each RecordID (for example, if you're looking up
  1794. attributes for only one RecordID), pass nil for eachRecordID.
  1795.  
  1796. After forEachLocalRecordIDFunc is called, eachAttrType may be called to pass an
  1797. attribute type (one from attrTypeList) that exists in the record specified
  1798. in the last eachRecordID call.  If you don't want to get a call-back for
  1799. each AttributeType (for example, if you're looking up only one attribute type,
  1800. or you prefer to read the type from the Attribute struct during the eachAttrValue
  1801. call-back routine), pass nil for eachAttrType. However access controls may
  1802. prohibit you from reading some attribute types; in that case eachAttrValue
  1803. may not be called even though the value exists. Hence the client should
  1804. supply this call-back function to see the access controls for each attribute type.
  1805.  
  1806. This will be followed by one or more calls to eachAttrValue, to pass the
  1807. type, tag, and attribute value.  NOTE THIS CHANGE:  you are no longer expected to
  1808. pass a pointer to a buffer in which to put the value.  Now you get a pointer to
  1809. the value, and you can process it within the call-back routine.
  1810. After one or more values are returned, eachAttrType may be called again to pass
  1811. another attribute type that exists in the last-specified RecordID.
  1812.  
  1813. The client should return FALSE from eachRecordID, eachAttrType, and
  1814. eachAttrValue to continue processing of the LookupParse request.  Returning TRUE
  1815. from any call-back will terminate the LookupParse request.
  1816.  
  1817. If LookupGet has failed with kOCEMoreData error, LookupParse will check to make sure that
  1818. ForEachAttributeValueFunc has been called at least once. If so, the client has the option
  1819. to continue from that attribute CreationID (for PAB/ADAP) in the next LookupGet call.
  1820. However, if it was not even called once, then the attribute value may be too big to fit in the
  1821. user's buffer. In this case, lastAttrValueCID (lastAttribute) and attrSize are returned in the
  1822. parse buffer and the call will fail with kOCEMoreAttrValue. However, it is possible that
  1823. ForEachAttributeValue was not called because the user does not have read access to some of
  1824. the attributeTypes in the list, and the buffer was full before even reading the creationID of
  1825. any of the attribute values.  A kOCEMoreData error is returned.
  1826.  
  1827. For synchronous calls, the call-back routine actually runs as part of the same thread
  1828. of execution as the thread that made the LookupParse call.  That means that the
  1829. same low-memory globals, A5, stack, etc. are in effect during the call-back
  1830. that were in effect when the call was made.  Because of this, the call-back
  1831. routine has the same restrictions as the caller of LookupParse:
  1832. if LookupParse was not called from interrupt level, then the call-
  1833. back routine can allocate memory. For asynchronous calls, call-back routine is
  1834. like a ioCompletion except that A5 will be preserved for the application.
  1835. */
  1836. struct DirLookupParsePB {
  1837.     Ptr                                qLink;
  1838.     long                            reserved1;
  1839.     long                            reserved2;
  1840.     DirIOCompletionUPP                ioCompletion;
  1841.     OSErr                            ioResult;
  1842.     unsigned long                    saveA5;
  1843.     short                            reqCode;
  1844.     long                            reserved[2];
  1845.     AddrBlock                        serverHint;
  1846.     short                            dsRefNum;
  1847.     unsigned long                    callID;
  1848.     AuthIdentity                    identity;
  1849.     long                            gReserved1;
  1850.     long                            gReserved2;
  1851.     long                            gReserved3;
  1852.     long                            clientData;
  1853.     RecordIDPtr                        *aRecordList;                /*  --> must be same from the corresponding Get call */
  1854.     AttributeTypePtr                *attrTypeList;                /*  --> must be same from the corresponding Get call */
  1855.     long                            cReserved;                    /*  --  */
  1856.     ForEachLookupRecordID            eachRecordID;                /*  --> */
  1857.     ForEachAttrTypeLookup            eachAttrType;                /*  --> */
  1858.     ForEachAttrValue                eachAttrValue;                /*  --> */
  1859.     unsigned long                    recordIDCount;                /*  --> must be same from the corresponding Get call */
  1860.     unsigned long                    attrTypeCount;                /*  --> must be same from the corresponding Get call */
  1861.     long                            iReserved;                    /*  --  */
  1862.     Ptr                                getBuffer;                    /*  --> must be same from the corresponding Get call*/
  1863.     unsigned long                    getBufferSize;                /*  --> must be same from the corresponding Get call*/
  1864.     unsigned long                    lastRecordIndex;            /* <--  last RecordID processed when parse completed */
  1865.     unsigned long                    lastAttributeIndex;            /* <--  last Attribute Type processed when parse completed */
  1866.     Attribute                        lastAttribute;                /* <--  last attribute value (with this CreationID) processed when parse completed */
  1867.     unsigned long                    attrSize;                    /* <--  length of the attribute we did not return */
  1868. };
  1869. typedef struct DirLookupParsePB DirLookupParsePB;
  1870.  
  1871. /* AddAttributeValue */
  1872. struct DirAddAttributeValuePB {
  1873.     Ptr                                qLink;
  1874.     long                            reserved1;
  1875.     long                            reserved2;
  1876.     DirIOCompletionUPP                ioCompletion;
  1877.     OSErr                            ioResult;
  1878.     unsigned long                    saveA5;
  1879.     short                            reqCode;
  1880.     long                            reserved[2];
  1881.     AddrBlock                        serverHint;
  1882.     short                            dsRefNum;
  1883.     unsigned long                    callID;
  1884.     AuthIdentity                    identity;
  1885.     long                            gReserved1;
  1886.     long                            gReserved2;
  1887.     long                            gReserved3;
  1888.     long                            clientData;
  1889.     RecordIDPtr                        aRecord;                    /*  --> */
  1890.     AttributePtr                    attr;                        /*  --> AttributeCreationID returned here */
  1891. };
  1892. typedef struct DirAddAttributeValuePB DirAddAttributeValuePB;
  1893.  
  1894. /*
  1895. aRecord must contain valid PackedRLI and a CreationID.
  1896.  
  1897. Instead of passing type, length, and value in three separate
  1898. fields, we take a pointer to an Attribute structure that contains
  1899. all three, and has room for the AttributeCreationNumber.
  1900. The AttributeCreationID will be returned in the attr itself.
  1901.  
  1902. The AttributeTag tells the catalog service that the attribute is an RString,
  1903. binary, or a RecordID.
  1904. */
  1905. /*
  1906. DeleteAttributeType:
  1907. This call is provided so that an existing AttributeType can be deleted.
  1908. If any attribute values exist for this type, they will all be deleted
  1909. (if the user has access rights to delete the values) and then the attribute type
  1910. will be deleted. Otherwise dsAccessDenied error will be returned.
  1911. */
  1912. struct DirDeleteAttributeTypePB {
  1913.     Ptr                                qLink;
  1914.     long                            reserved1;
  1915.     long                            reserved2;
  1916.     DirIOCompletionUPP                ioCompletion;
  1917.     OSErr                            ioResult;
  1918.     unsigned long                    saveA5;
  1919.     short                            reqCode;
  1920.     long                            reserved[2];
  1921.     AddrBlock                        serverHint;
  1922.     short                            dsRefNum;
  1923.     unsigned long                    callID;
  1924.     AuthIdentity                    identity;
  1925.     long                            gReserved1;
  1926.     long                            gReserved2;
  1927.     long                            gReserved3;
  1928.     long                            clientData;
  1929.     RecordIDPtr                        aRecord;                    /*  --> */
  1930.     AttributeTypePtr                attrType;                    /*  --> */
  1931. };
  1932. typedef struct DirDeleteAttributeTypePB DirDeleteAttributeTypePB;
  1933.  
  1934. /*
  1935.     DeleteAttributeValue
  1936. */
  1937. struct DirDeleteAttributeValuePB {
  1938.     Ptr                                qLink;
  1939.     long                            reserved1;
  1940.     long                            reserved2;
  1941.     DirIOCompletionUPP                ioCompletion;
  1942.     OSErr                            ioResult;
  1943.     unsigned long                    saveA5;
  1944.     short                            reqCode;
  1945.     long                            reserved[2];
  1946.     AddrBlock                        serverHint;
  1947.     short                            dsRefNum;
  1948.     unsigned long                    callID;
  1949.     AuthIdentity                    identity;
  1950.     long                            gReserved1;
  1951.     long                            gReserved2;
  1952.     long                            gReserved3;
  1953.     long                            clientData;
  1954.     RecordIDPtr                        aRecord;                    /*  -> */
  1955.     AttributePtr                    attr;                        /*  -> */
  1956. };
  1957. typedef struct DirDeleteAttributeValuePB DirDeleteAttributeValuePB;
  1958.  
  1959. /*
  1960.     ChangeAttributeValue:
  1961.     currentAttr ==> the attribute to be changed. For ADAS and PAB CreationID is
  1962.                     sufficient
  1963.     newAttr     ==> new value for the attribute. For ADAS and PAB 
  1964.                     CreationID field will be set when
  1965.                     the call succeesfully completes
  1966.     
  1967.     aRecord     ==> must contain valid PackedRecordLocationInfo and a CreationID.
  1968.  
  1969.  
  1970.     
  1971. */
  1972. struct DirChangeAttributeValuePB {
  1973.     Ptr                                qLink;
  1974.     long                            reserved1;
  1975.     long                            reserved2;
  1976.     DirIOCompletionUPP                ioCompletion;
  1977.     OSErr                            ioResult;
  1978.     unsigned long                    saveA5;
  1979.     short                            reqCode;
  1980.     long                            reserved[2];
  1981.     AddrBlock                        serverHint;
  1982.     short                            dsRefNum;
  1983.     unsigned long                    callID;
  1984.     AuthIdentity                    identity;
  1985.     long                            gReserved1;
  1986.     long                            gReserved2;
  1987.     long                            gReserved3;
  1988.     long                            clientData;
  1989.     RecordIDPtr                        aRecord;                    /*  -> */
  1990.     AttributePtr                    currentAttr;                /*  -> */
  1991.     AttributePtr                    newAttr;                    /*  -> */
  1992. };
  1993. typedef struct DirChangeAttributeValuePB DirChangeAttributeValuePB;
  1994.  
  1995. /* VerifyAttributeValue */
  1996. struct DirVerifyAttributeValuePB {
  1997.     Ptr                                qLink;
  1998.     long                            reserved1;
  1999.     long                            reserved2;
  2000.     DirIOCompletionUPP                ioCompletion;
  2001.     OSErr                            ioResult;
  2002.     unsigned long                    saveA5;
  2003.     short                            reqCode;
  2004.     long                            reserved[2];
  2005.     AddrBlock                        serverHint;
  2006.     short                            dsRefNum;
  2007.     unsigned long                    callID;
  2008.     AuthIdentity                    identity;
  2009.     long                            gReserved1;
  2010.     long                            gReserved2;
  2011.     long                            gReserved3;
  2012.     long                            clientData;
  2013.     RecordIDPtr                        aRecord;                    /*  --> */
  2014.     AttributePtr                    attr;                        /*  --> */
  2015. };
  2016. typedef struct DirVerifyAttributeValuePB DirVerifyAttributeValuePB;
  2017.  
  2018. /*
  2019. aRecord must contain valid PackedRLI and a CreationID.
  2020.  
  2021. The attribute type and value are passed in the attribute structure.  If the
  2022. attribute CreationID is non-zero, the server will verify that an attribute with
  2023. the specified value and creation number exists in aRecord.  If the attribute
  2024. CreationID is zero, the server will verify the attribute by type and value
  2025. alone, and return the attribute CreationID in the Attribute struct if the
  2026. attribute exists.
  2027. */
  2028. /*
  2029. EnumerateAttributeTypesGet:
  2030. The following two calls can be used to enumerate the attribute types present in
  2031. a specified RecordID.  The first, EnumerateAttributeTypesGet, processes the request
  2032. and reads the response into getBuffer, as much as will fit.  A kOCEMoreData error will
  2033. be returned if the buffer was not large enough.  After this call completes, the
  2034. client can call EnumerateAttributeTypesParse (see below).
  2035.  
  2036. The user will able to continue from a startingPoint by setting a startingAttrType.
  2037. Typically, this should be the last value returned in EnumerateAttributeTypesParse call
  2038. when 'kOCEMoreData' is returned.
  2039.  
  2040. If 'includeStartingPoint' is true when a 'startingAttrType' is specified, the starting value
  2041. will be included in the results, if it exists. If this is set to false, this value will not
  2042. be included. AttributeTypes following this type will be returned.
  2043. */
  2044. struct DirEnumerateAttributeTypesGetPB {
  2045.     Ptr                                qLink;
  2046.     long                            reserved1;
  2047.     long                            reserved2;
  2048.     DirIOCompletionUPP                ioCompletion;
  2049.     OSErr                            ioResult;
  2050.     unsigned long                    saveA5;
  2051.     short                            reqCode;
  2052.     long                            reserved[2];
  2053.     AddrBlock                        serverHint;
  2054.     short                            dsRefNum;
  2055.     unsigned long                    callID;
  2056.     AuthIdentity                    identity;
  2057.     long                            gReserved1;
  2058.     long                            gReserved2;
  2059.     long                            gReserved3;
  2060.     long                            clientData;
  2061.     RecordIDPtr                        aRecord;                    /*  --> */
  2062.     AttributeTypePtr                startingAttrType;            /*  --> starting point */
  2063.     long                            cReserved;                    /*  --  */
  2064.     long                            dReserved;                    /*  --  */
  2065.     long                            eReserved;                    /*  --  */
  2066.     long                            fReserved;                    /*  --  */
  2067.     long                            gReserved;                    /*  --  */
  2068.     long                            hReserved;                    /*  --  */
  2069.     Boolean                            includeStartingPoint;        /*  --> if true return the attrType specified by starting point */
  2070.     Byte                            padByte;
  2071.     short                            i1Reserved;                    /*  --  */
  2072.     Ptr                                getBuffer;                    /*  --> */
  2073.     unsigned long                    getBufferSize;                /*  --> */
  2074. };
  2075. typedef struct DirEnumerateAttributeTypesGetPB DirEnumerateAttributeTypesGetPB;
  2076.  
  2077. /* The call-back function is defined as follows: */
  2078. typedef pascal Boolean (*ForEachAttrTypeProcPtr)(long clientData, const AttributeType *attrType);
  2079.  
  2080. #if GENERATINGCFM
  2081. typedef UniversalProcPtr ForEachAttrTypeUPP;
  2082. #else
  2083. typedef ForEachAttrTypeProcPtr ForEachAttrTypeUPP;
  2084. #endif
  2085.  
  2086. typedef ForEachAttrTypeUPP ForEachAttrType;
  2087.  
  2088. /*
  2089. EnumerateAttributeTypesParse:
  2090. After an EnumerateAttributeTypesGet call has completed, call EnumerateAttributeTypesParse
  2091. to parse through the buffer that was filled in EnumerateAttributeTypesGet.  The
  2092. toolbox will parse through the buffer and call the call-back routine for
  2093. each attribute type in the getBuffer.
  2094.  
  2095. The client should return false from eachAttrType to continue
  2096. processing of the EnumerateAttributeTypesParse request.  Returning true will
  2097. terminate the EnumerateAttributeTypesParse request.  The clientData parameter that
  2098. you pass in the parameter block will be passed to eachAttrType.
  2099. You are free to put anything in clientData - it is intended to allow
  2100. you some way to match the call-back to the original call (in case, for
  2101. example, you make simultaneous asynchronous calls).
  2102.  
  2103. For synchronous calls, the call-back routine actually runs as part of the same thread
  2104. of execution as the thread that made the EnumerateAttributeTypesParse call.  That means that the
  2105. same low-memory globals, A5, stack, etc. are in effect during the call-back
  2106. that were in effect when the call was made.  Because of this, the call-back
  2107. routine has the same restrictions as the caller of EnumerateAttributeTypesParse.
  2108. If EnumerateAttributeTypesParse was not called from interrupt level, then the call-
  2109. back routine can allocate memory. For asynchronous calls, call-back routine is
  2110. like a ioCompletion except that A5 will be preserved for the application.
  2111. */
  2112. struct DirEnumerateAttributeTypesParsePB {
  2113.     Ptr                                qLink;
  2114.     long                            reserved1;
  2115.     long                            reserved2;
  2116.     DirIOCompletionUPP                ioCompletion;
  2117.     OSErr                            ioResult;
  2118.     unsigned long                    saveA5;
  2119.     short                            reqCode;
  2120.     long                            reserved[2];
  2121.     AddrBlock                        serverHint;
  2122.     short                            dsRefNum;
  2123.     unsigned long                    callID;
  2124.     AuthIdentity                    identity;
  2125.     long                            gReserved1;
  2126.     long                            gReserved2;
  2127.     long                            gReserved3;
  2128.     long                            clientData;
  2129.     RecordIDPtr                        aRecord;                    /*  --> Same as DirEnumerateAttributeTypesGetPB */
  2130.     long                            bReserved;                    /*  --  */
  2131.     long                            cReserved;                    /*  --  */
  2132.     long                            dReserved;                    /*  --  */
  2133.     ForEachAttrType                    eachAttrType;                /*  --> */
  2134.     long                            fReserved;                    /*  --  */
  2135.     long                            gReserved;                    /*  --  */
  2136.     long                            hReserved;                    /*  --  */
  2137.     long                            iReserved;                    /*  --  */
  2138.     Ptr                                getBuffer;                    /*  --> */
  2139.     unsigned long                    getBufferSize;                /*  --> */
  2140. };
  2141. typedef struct DirEnumerateAttributeTypesParsePB DirEnumerateAttributeTypesParsePB;
  2142.  
  2143. /*
  2144. DirAbort:
  2145. With this call a user will able to abort an outstanding catalog service call.
  2146. A user must pass a pointer to the parameter block for the outstanding call.
  2147. In the current version of the product, the toolbox will process this call
  2148. for NetSearchADAPDirectoriesGet or FindADAPDirectoryByNetSearch calls and if possible
  2149. it will abort. For other calls for ADAP and PAB this will return 'daAbortFailErr'.
  2150. For CSAM catalogs, this call will be passed to the corresponding CSAM driver.
  2151. The CSAM driver may process this call or may return 'daAbortFailErr'. This call can
  2152. be called only in synchronous mode. Since the abort call makes references to fields in
  2153. the pb associated with the original call, this pb must not be disposed or or altered if
  2154. the original call completes before the abort call has completed.
  2155. */
  2156. struct DirAbortPB {
  2157.     Ptr                                qLink;
  2158.     long                            reserved1;
  2159.     long                            reserved2;
  2160.     DirIOCompletionUPP                ioCompletion;
  2161.     OSErr                            ioResult;
  2162.     unsigned long                    saveA5;
  2163.     short                            reqCode;
  2164.     long                            reserved[2];
  2165.     AddrBlock                        serverHint;
  2166.     short                            dsRefNum;
  2167.     unsigned long                    callID;
  2168.     AuthIdentity                    identity;
  2169.     long                            gReserved1;
  2170.     long                            gReserved2;
  2171.     long                            gReserved3;
  2172.     long                            clientData;
  2173.     DirParamBlock                    *pb;                        /*  --> pb for the call which must be aborted */
  2174. };
  2175. typedef struct DirAbortPB DirAbortPB;
  2176.  
  2177. /*
  2178. AddPseudonym:
  2179. An alternate name and type can be added to a given record. If allowDuplicate
  2180. is set the name and type will be added even if the same name and type already
  2181. exists.
  2182. */
  2183. struct DirAddPseudonymPB {
  2184.     Ptr                                qLink;
  2185.     long                            reserved1;
  2186.     long                            reserved2;
  2187.     DirIOCompletionUPP                ioCompletion;
  2188.     OSErr                            ioResult;
  2189.     unsigned long                    saveA5;
  2190.     short                            reqCode;
  2191.     long                            reserved[2];
  2192.     AddrBlock                        serverHint;
  2193.     short                            dsRefNum;
  2194.     unsigned long                    callID;
  2195.     AuthIdentity                    identity;
  2196.     long                            gReserved1;
  2197.     long                            gReserved2;
  2198.     long                            gReserved3;
  2199.     long                            clientData;
  2200.     RecordIDPtr                        aRecord;                    /*  --> RecordID to which pseudonym is to be added */
  2201.     RStringPtr                        pseudonymName;                /*  --> new name to be added as pseudonym */
  2202.     RStringPtr                        pseudonymType;                /*  --> new name to be added as pseudonym */
  2203.     Boolean                            allowDuplicate;                /*  --> */
  2204.     Boolean                            filler1;
  2205. };
  2206. typedef struct DirAddPseudonymPB DirAddPseudonymPB;
  2207.  
  2208. /*
  2209. DeletePseudonym:
  2210. An alternate name and type for a given record can be deleted.
  2211. */
  2212. struct DirDeletePseudonymPB {
  2213.     Ptr                                qLink;
  2214.     long                            reserved1;
  2215.     long                            reserved2;
  2216.     DirIOCompletionUPP                ioCompletion;
  2217.     OSErr                            ioResult;
  2218.     unsigned long                    saveA5;
  2219.     short                            reqCode;
  2220.     long                            reserved[2];
  2221.     AddrBlock                        serverHint;
  2222.     short                            dsRefNum;
  2223.     unsigned long                    callID;
  2224.     AuthIdentity                    identity;
  2225.     long                            gReserved1;
  2226.     long                            gReserved2;
  2227.     long                            gReserved3;
  2228.     long                            clientData;
  2229.     RecordIDPtr                        aRecord;                    /*  --> RecordID to which pseudonym to be added */
  2230.     RStringPtr                        pseudonymName;                /*  --> pseudonymName to be deleted */
  2231.     RStringPtr                        pseudonymType;                /*  --> pseudonymType to be deleted */
  2232. };
  2233. typedef struct DirDeletePseudonymPB DirDeletePseudonymPB;
  2234.  
  2235. /*
  2236.     AddAlias:
  2237.     This call can be used to create an alias  record. The alias
  2238.     can be created either in the same or different cluster. ADAS will not support
  2239.     this call for this release. A new catalog capability flag 'kSupportsAlias' will indicate
  2240.     if the catalog supports this call. PAB's will support this call. For the PAB implementation,
  2241.     this call will create a record with the name and type specified an aRecord.
  2242.     This call works exactly like AddRecord.
  2243.     If 'allowDuplicate' is false and another record with same name and type already exists
  2244.     'daNoDupAllowed' error will be returned.
  2245. */
  2246. struct DirAddAliasPB {
  2247.     Ptr                                qLink;
  2248.     long                            reserved1;
  2249.     long                            reserved2;
  2250.     DirIOCompletionUPP                ioCompletion;
  2251.     OSErr                            ioResult;
  2252.     unsigned long                    saveA5;
  2253.     short                            reqCode;
  2254.     long                            reserved[2];
  2255.     AddrBlock                        serverHint;
  2256.     short                            dsRefNum;
  2257.     unsigned long                    callID;
  2258.     AuthIdentity                    identity;
  2259.     long                            gReserved1;
  2260.     long                            gReserved2;
  2261.     long                            gReserved3;
  2262.     long                            clientData;
  2263.     RecordIDPtr                        aRecord;                    /*  -> */
  2264.     Boolean                            allowDuplicate;                /*  -> */
  2265.     Boolean                            filler1;
  2266. };
  2267. typedef struct DirAddAliasPB DirAddAliasPB;
  2268.  
  2269. /*
  2270. DirFindValue:
  2271. This call can be used to find the occurrence of a value. The value
  2272. to be matched is passed in the buffer 'matchingData' field. The current
  2273. ADAP/PAB implementation will match a maximum of 32 bytes of data.
  2274. For attribute values in the PAB/ADAP implementation, only the first 32 bytes will
  2275. be used for comparing the occurrence of data. Search can be restricted to
  2276. a particular record and/or attribute type by specifying 'aRecord' or 'aType'.
  2277. After finding one occurrence, 'startingRecord' and 'startingAttribute'
  2278. can be specified to find the next occurrence of the same value.
  2279. 'sortDirection' can be specified with starting values to search forward or backward.
  2280. When a matching value is found, the 'recordFound' indicates the reccordID in which the
  2281. data occurrence was found, 'attributeFound' indicates the attribute with in which the
  2282. matching data was found. ADAP/PAB implementation returns only the type and creationID of
  2283. attributes. Catalogs which don't support creationIDs may return the
  2284. complete value; hence this call may need a buffer to hold the data. For ADAP/PAB implementations
  2285. the user has to make a DirLookup call to get the actual data. 'recordFound' and
  2286. 'attributeFound' can be used to initialize 'startingRecord' and 'startingAttribute' to
  2287. find the next occurrence of the value.
  2288. */
  2289. struct DirFindValuePB {
  2290.     Ptr                                qLink;
  2291.     long                            reserved1;
  2292.     long                            reserved2;
  2293.     DirIOCompletionUPP                ioCompletion;
  2294.     OSErr                            ioResult;
  2295.     unsigned long                    saveA5;
  2296.     short                            reqCode;
  2297.     long                            reserved[2];
  2298.     AddrBlock                        serverHint;
  2299.     short                            dsRefNum;
  2300.     unsigned long                    callID;
  2301.     AuthIdentity                    identity;
  2302.     long                            gReserved1;
  2303.     long                            gReserved2;
  2304.     long                            gReserved3;
  2305.     long                            clientData;
  2306.     PackedRLIPtr                    aRLI;                        /*  --> an RLI specifying the cluster to be enumerated */
  2307.     LocalRecordIDPtr                aRecord;                    /*  --> if not nil, look only in this record */
  2308.     AttributeTypePtr                attrType;                    /*  --> if not nil, look only in this attribute type */
  2309.     LocalRecordIDPtr                startingRecord;                /*  --> record in which to start searching */
  2310.     AttributePtr                    startingAttribute;            /*  --> attribute in which to start searching */
  2311.     LocalRecordIDPtr                recordFound;                /* <--  record in which data was found */
  2312.     Attribute                        attributeFound;                /* <--  attribute in which data was found */
  2313.     unsigned long                    matchSize;                    /*  --> length of matching bytes */
  2314.     Ptr                                matchingData;                /*  --> data bytes to be matched in search */
  2315.     DirSortDirection                sortDirection;                /*  --> sort direction (forwards or backwards) */
  2316. };
  2317. typedef struct DirFindValuePB DirFindValuePB;
  2318.  
  2319. /*
  2320. EnumeratePseudonymGet:
  2321. This call can be used to enumerate the existing pseudonyms for
  2322. a given record specified in 'aRecord'. A starting point can be specified
  2323. by 'startingName' and 'startingType'. If the 'includeStartingPoint' boolean
  2324. is true and a starting point is specified, the name specified by startingName
  2325. and startingType also is returned in the results, if it exists. If this is set to false,
  2326. the pseudonym in startingName and Type is not included.
  2327. Pseudonyms returned in the 'getBuffer' can be extracted by making an
  2328. EnumeratePseudonymParse call. The results will consist of a RecordID with the
  2329. name and type of the pseudonym. If the buffer could not hold all the results, then
  2330. 'kOCEMoreData' error will be returned. The user will be able to continue the call by
  2331. using the last result returned as starting point for the next call.
  2332. */
  2333. struct DirEnumeratePseudonymGetPB {
  2334.     Ptr                                qLink;
  2335.     long                            reserved1;
  2336.     long                            reserved2;
  2337.     DirIOCompletionUPP                ioCompletion;
  2338.     OSErr                            ioResult;
  2339.     unsigned long                    saveA5;
  2340.     short                            reqCode;
  2341.     long                            reserved[2];
  2342.     AddrBlock                        serverHint;
  2343.     short                            dsRefNum;
  2344.     unsigned long                    callID;
  2345.     AuthIdentity                    identity;
  2346.     long                            gReserved1;
  2347.     long                            gReserved2;
  2348.     long                            gReserved3;
  2349.     long                            clientData;
  2350.     RecordIDPtr                        aRecord;                    /*  --> */
  2351.     RStringPtr                        startingName;                /*  --> */
  2352.     RStringPtr                        startingType;                /*  --> */
  2353.     long                            dReserved;                    /*  --  */
  2354.     long                            eReserved;                    /*  --  */
  2355.     long                            fReserved;                    /*  --  */
  2356.     long                            gReserved;                    /*  --  */
  2357.     long                            hReserved;                    /*  --  */
  2358.     Boolean                            includeStartingPoint;        /*  --> if true return the Pseudonym specified by starting point will be included */
  2359.     Byte                            padByte;
  2360.     short                            i1Reserved;                    /*  --  */
  2361.     Ptr                                getBuffer;                    /*  --> */
  2362.     unsigned long                    getBufferSize;                /*  --> */
  2363. };
  2364. typedef struct DirEnumeratePseudonymGetPB DirEnumeratePseudonymGetPB;
  2365.  
  2366. /* The call-back function is defined as follows: */
  2367. typedef pascal Boolean (*ForEachRecordIDProcPtr)(long clientData, const RecordID *recordID);
  2368.  
  2369. #if GENERATINGCFM
  2370. typedef UniversalProcPtr ForEachRecordIDUPP;
  2371. #else
  2372. typedef ForEachRecordIDProcPtr ForEachRecordIDUPP;
  2373. #endif
  2374.  
  2375. typedef ForEachRecordIDUPP ForEachRecordID;
  2376.  
  2377. /*
  2378. EnumeratePseudonymParse:
  2379. The pseudonyms returned in the 'getBuffer' from the EnumeratePseudonymGet call
  2380. can be extracted by using the EnumeratePseudonymParse call. 'eachRecordID'
  2381. will be called for each pseudonym.
  2382.  
  2383. Returning true from any call-back will terminate the EnumeratePseudonymParse call.
  2384.  
  2385. For synchronous calls, the call-back routine actually runs as part of the same thread
  2386. of execution as the thread that made the EnumeratePseudonymParse call.  That means that the
  2387. same low-memory globals, A5, stack, etc. are in effect during the call-back
  2388. that were in effect when the call was made.  Because of this, the call-back
  2389. routine has the same restrictions as the caller of EnumeratePseudonymParse:
  2390. if EnumeratePseudonymParse was not called from interrupt level, then the call-
  2391. back routine can allocate memory. For asynchronous calls, call-back routine is
  2392. like a ioCompletion except that A5 will be preserved for the application.
  2393. */
  2394. struct DirEnumeratePseudonymParsePB {
  2395.     Ptr                                qLink;
  2396.     long                            reserved1;
  2397.     long                            reserved2;
  2398.     DirIOCompletionUPP                ioCompletion;
  2399.     OSErr                            ioResult;
  2400.     unsigned long                    saveA5;
  2401.     short                            reqCode;
  2402.     long                            reserved[2];
  2403.     AddrBlock                        serverHint;
  2404.     short                            dsRefNum;
  2405.     unsigned long                    callID;
  2406.     AuthIdentity                    identity;
  2407.     long                            gReserved1;
  2408.     long                            gReserved2;
  2409.     long                            gReserved3;
  2410.     long                            clientData;
  2411.     RecordIDPtr                        aRecord;                    /*  --> same as DirEnumerateAliasesGetPB */
  2412.     long                            bReserved;                    /*  --  */
  2413.     long                            cReserved;                    /*  --  */
  2414.     ForEachRecordID                    eachRecordID;                /*  --> */
  2415.     long                            eReserved;                    /*  --  */
  2416.     long                            fReserved;                    /*  --  */
  2417.     long                            gReserved;                    /*  --  */
  2418.     long                            hReserved;                    /*  --  */
  2419.     long                            iReserved;                    /*  --  */
  2420.     Ptr                                getBuffer;                    /*  --> */
  2421.     unsigned long                    getBufferSize;                /*  --> */
  2422. };
  2423. typedef struct DirEnumeratePseudonymParsePB DirEnumeratePseudonymParsePB;
  2424.  
  2425. /* GetNameAndType */
  2426. struct DirGetNameAndTypePB {
  2427.     Ptr                                qLink;
  2428.     long                            reserved1;
  2429.     long                            reserved2;
  2430.     DirIOCompletionUPP                ioCompletion;
  2431.     OSErr                            ioResult;
  2432.     unsigned long                    saveA5;
  2433.     short                            reqCode;
  2434.     long                            reserved[2];
  2435.     AddrBlock                        serverHint;
  2436.     short                            dsRefNum;
  2437.     unsigned long                    callID;
  2438.     AuthIdentity                    identity;
  2439.     long                            gReserved1;
  2440.     long                            gReserved2;
  2441.     long                            gReserved3;
  2442.     long                            clientData;
  2443.     RecordIDPtr                        aRecord;                    /*  --> */
  2444. };
  2445. typedef struct DirGetNameAndTypePB DirGetNameAndTypePB;
  2446.  
  2447. /*
  2448. aRecord must contain valid RLI and a CreationID.  It
  2449. must also contain pointers to maximum-length RStrings (name and type fields)
  2450. in which will be returned the record's distinguished name and type.
  2451. */
  2452. /*
  2453. SetNameAndType:
  2454. This call can be used to change a name and type for a record. The record
  2455. to be renamed is specified using 'aRecord'.
  2456. 'newName' and 'newType' indicate the name and type to be set.
  2457. 'allowDuplicate' if true indicates that name is to be set even if another
  2458. name and type exactly matches the newName and newType specified.
  2459.  
  2460. 'newName' and 'newType' are required since the catalogs not supporting
  2461. CreationID require name and type fields in the recordID to identify a given
  2462. record.
  2463. */
  2464. struct DirSetNameAndTypePB {
  2465.     Ptr                                qLink;
  2466.     long                            reserved1;
  2467.     long                            reserved2;
  2468.     DirIOCompletionUPP                ioCompletion;
  2469.     OSErr                            ioResult;
  2470.     unsigned long                    saveA5;
  2471.     short                            reqCode;
  2472.     long                            reserved[2];
  2473.     AddrBlock                        serverHint;
  2474.     short                            dsRefNum;
  2475.     unsigned long                    callID;
  2476.     AuthIdentity                    identity;
  2477.     long                            gReserved1;
  2478.     long                            gReserved2;
  2479.     long                            gReserved3;
  2480.     long                            clientData;
  2481.     RecordIDPtr                        aRecord;                    /*  --> */
  2482.     Boolean                            allowDuplicate;                /*  --> */
  2483.     Byte                            padByte;
  2484.     RStringPtr                        newName;                    /*  --> new name for the record */
  2485.     RStringPtr                        newType;                    /*  --> new type for the record */
  2486. };
  2487. typedef struct DirSetNameAndTypePB DirSetNameAndTypePB;
  2488.  
  2489. /*
  2490. DirGetMetaRecordInfo: This call can be made to obtain
  2491. the MetaRecordInfo for a given record. Information returned
  2492. is 16 bytes of OPAQUE information about the record.
  2493. */
  2494. struct DirGetRecordMetaInfoPB {
  2495.     Ptr                                qLink;
  2496.     long                            reserved1;
  2497.     long                            reserved2;
  2498.     DirIOCompletionUPP                ioCompletion;
  2499.     OSErr                            ioResult;
  2500.     unsigned long                    saveA5;
  2501.     short                            reqCode;
  2502.     long                            reserved[2];
  2503.     AddrBlock                        serverHint;
  2504.     short                            dsRefNum;
  2505.     unsigned long                    callID;
  2506.     AuthIdentity                    identity;
  2507.     long                            gReserved1;
  2508.     long                            gReserved2;
  2509.     long                            gReserved3;
  2510.     long                            clientData;
  2511.     RecordIDPtr                        aRecord;                    /*  --> */
  2512.     DirMetaInfo                        metaInfo;                    /* <--  */
  2513. };
  2514. typedef struct DirGetRecordMetaInfoPB DirGetRecordMetaInfoPB;
  2515.  
  2516. /*
  2517. DirGetDNodeMetaInfo: This call can be made to obtain
  2518. the DNodeMetaInfo for a given Packed RLI. Information returned
  2519. is 16 bytes of OPAQUE information about the DNode.
  2520. */
  2521. struct DirGetDNodeMetaInfoPB {
  2522.     Ptr                                qLink;
  2523.     long                            reserved1;
  2524.     long                            reserved2;
  2525.     DirIOCompletionUPP                ioCompletion;
  2526.     OSErr                            ioResult;
  2527.     unsigned long                    saveA5;
  2528.     short                            reqCode;
  2529.     long                            reserved[2];
  2530.     AddrBlock                        serverHint;
  2531.     short                            dsRefNum;
  2532.     unsigned long                    callID;
  2533.     AuthIdentity                    identity;
  2534.     long                            gReserved1;
  2535.     long                            gReserved2;
  2536.     long                            gReserved3;
  2537.     long                            clientData;
  2538.     PackedRLIPtr                    pRLI;                        /*  --> */
  2539.     DirMetaInfo                        metaInfo;                    /* <--  */
  2540. };
  2541. typedef struct DirGetDNodeMetaInfoPB DirGetDNodeMetaInfoPB;
  2542.  
  2543. /*
  2544. EnumerateDirectoriesGet:
  2545. A user can enumerate all the catalogs installed. This includes installed
  2546. ADAP and CSAM catalogs. The user can specify a signature as input to restrict
  2547. the results. kDirADAPKind will return only ADAP catalogs, kDirDSAMKind
  2548. will return all CSAM catalogs. kDirAllKinds will get both ADAP & CSAM catalogs.
  2549. A specific signature (e.g. X.500) may be used to get catalogs with an X.500 signature.
  2550. The information for each catalog returned will have directoryName, discriminator and features.
  2551.  
  2552. If the user receives 'noErr' or 'kOCEMoreData', the buffer will contain valid results. A user
  2553. can extract the results in the 'getBuffer' by making an DirEnumerateDirectories call.
  2554.  
  2555. If 'kOCEMoreData' is received, the user can continue enumeration by using the last catalog and
  2556. discriminator as startingDirectoryName and staringDirDiscriminator in the next call.
  2557.  
  2558. If 'includeStartingPoint' is true and a starting point is specified,
  2559. the staring point will be returned in the result. If false, it is not included.
  2560. */
  2561. struct DirEnumerateDirectoriesGetPB {
  2562.     Ptr                                qLink;
  2563.     long                            reserved1;
  2564.     long                            reserved2;
  2565.     DirIOCompletionUPP                ioCompletion;
  2566.     OSErr                            ioResult;
  2567.     unsigned long                    saveA5;
  2568.     short                            reqCode;
  2569.     long                            reserved[2];
  2570.     AddrBlock                        serverHint;
  2571.     short                            dsRefNum;
  2572.     unsigned long                    callID;
  2573.     AuthIdentity                    identity;
  2574.     long                            gReserved1;
  2575.     long                            gReserved2;
  2576.     long                            gReserved3;
  2577.     long                            clientData;
  2578.     OCEDirectoryKind                directoryKind;                /*  --> enumerate catalogs bearing this signature */
  2579.     DirectoryNamePtr                startingDirectoryName;        /*  --> staring catalog name */
  2580.     DirDiscriminator                startingDirDiscriminator;    /*  --> staring catalog discriminator */
  2581.     long                            eReserved;                    /*  --  */
  2582.     long                            fReserved;                    /*  --  */
  2583.     long                            gReserved;                    /*  --  */
  2584.     long                            hReserved;                    /*  --  */
  2585.     Boolean                            includeStartingPoint;        /*  --> if true return the catalog specified by starting point */
  2586.     Byte                            padByte;
  2587.     short                            i1Reserved;                    /*  --  */
  2588.     Ptr                                getBuffer;                    /*  --> */
  2589.     unsigned long                    getBufferSize;                /*  --> */
  2590. };
  2591. typedef struct DirEnumerateDirectoriesGetPB DirEnumerateDirectoriesGetPB;
  2592.  
  2593. typedef pascal Boolean (*ForEachDirectoryProcPtr)(long clientData, const DirectoryName *dirName, const DirDiscriminator *discriminator, DirGestalt features);
  2594.  
  2595. #if GENERATINGCFM
  2596. typedef UniversalProcPtr ForEachDirectoryUPP;
  2597. #else
  2598. typedef ForEachDirectoryProcPtr ForEachDirectoryUPP;
  2599. #endif
  2600.  
  2601. typedef ForEachDirectoryUPP ForEachDirectory;
  2602.  
  2603. /*
  2604. EnumerateDirectoriesParse:
  2605. The catalog info returned in 'getBuffer' from the EnumerateDirectoriesGet call
  2606. can be extracted using the EnumerateDirectoriesParse call. 'eachDirectory' will
  2607. be called for each catalog.
  2608.  
  2609. Returning true from any call-back will terminate the EnumerateDirectoriesParse call.
  2610.  
  2611. For synchronous calls, the call-back routine actually runs as part of the same thread
  2612. of execution as the thread that made the EnumerateDirectoriesParse call.  That means that the
  2613. same low-memory globals, A5, stack, etc. are in effect during the call-back
  2614. that were in effect when the call was made.  Because of this, the call-back
  2615. routine has the same restrictions as the caller of EnumerateDirectoriesParse:
  2616. if EnumerateDirectoriesParse was not called from interrupt level, then the call-
  2617. back routine can allocate memory. For asynchronous calls, call-back routine is
  2618. like a ioCompletion except that A5 will be preserved for the application.
  2619.  
  2620. eachDirectory will be called each time to return to the client a
  2621. DirectoryName, DirDiscriminator, and features for that catalog.
  2622. */
  2623. struct DirEnumerateDirectoriesParsePB {
  2624.     Ptr                                qLink;
  2625.     long                            reserved1;
  2626.     long                            reserved2;
  2627.     DirIOCompletionUPP                ioCompletion;
  2628.     OSErr                            ioResult;
  2629.     unsigned long                    saveA5;
  2630.     short                            reqCode;
  2631.     long                            reserved[2];
  2632.     AddrBlock                        serverHint;
  2633.     short                            dsRefNum;
  2634.     unsigned long                    callID;
  2635.     AuthIdentity                    identity;
  2636.     long                            gReserved1;
  2637.     long                            gReserved2;
  2638.     long                            gReserved3;
  2639.     long                            clientData;
  2640.     long                            aReserved;                    /*  --  */
  2641.     long                            bReserved;                    /*  --  */
  2642.     long                            cReserved;                    /*  --  */
  2643.     long                            dReserved;                    /*  --  */
  2644.     ForEachDirectory                eachDirectory;                /*  --> */
  2645.     long                            fReserved;                    /*  --  */
  2646.     long                            gReserved;                    /*  --  */
  2647.     long                            hReserved;                    /*  --  */
  2648.     long                            iReserved;                    /*  --  */
  2649.     Ptr                                getBuffer;                    /*  --> */
  2650.     unsigned long                    getBufferSize;                /*  --> */
  2651. };
  2652. typedef struct DirEnumerateDirectoriesParsePB DirEnumerateDirectoriesParsePB;
  2653.  
  2654. /*
  2655. The Following five call are specific to ADAP Catalogs. Toolbox
  2656. remembers a list of catalogs across boots. If any catalog service
  2657. call is intended for a ADAP catalog, then it must be in the list.
  2658. In order for managing this list, A client (Probably DE will use these
  2659. calls.
  2660. DirAddADAPDirectoryPB: Add a new ADAP catalog to the list.
  2661. DirRemoveADAPDirectory: Remove a ADAP catalog from the list.
  2662. DirNetSearchADAPDirectoriesGet:   search an internet for adas catalogs.
  2663. DirNetSearchADAPDirectoriesParse: extract the results obtained NetSearchADAPDirectoriesGet.
  2664. DirFindADAPDirectoryByNetSearch: Find a specified catalog through net search.
  2665. */
  2666. /*
  2667. NetSearchADAPDirectoriesGet:
  2668. This call can be used to make a network wide search for finding ADAP catalogs.
  2669. This call will be supported only by 'ADAP' and involve highly expensive
  2670. network operations, so the user is advised to use utmost discretion before
  2671. making this call. The results will be collected in the 'getbuffer' and can be
  2672. extracted using NetSearchADAPDirectoriesParse call. The directoryName,
  2673. the directoryDiscriminator, features and serverHint (AppleTalk address for
  2674. a PathFinder serving that catalog) are collected for each catalog found
  2675. on the network. If buffer is too small to hold all the catalogs found on
  2676. the network, a 'kOCEMoreData' error will be returned.
  2677. */
  2678. struct DirNetSearchADAPDirectoriesGetPB {
  2679.     Ptr                                qLink;
  2680.     long                            reserved1;
  2681.     long                            reserved2;
  2682.     DirIOCompletionUPP                ioCompletion;
  2683.     OSErr                            ioResult;
  2684.     unsigned long                    saveA5;
  2685.     short                            reqCode;
  2686.     long                            reserved[2];
  2687.     AddrBlock                        serverHint;
  2688.     short                            dsRefNum;
  2689.     unsigned long                    callID;
  2690.     AuthIdentity                    identity;
  2691.     long                            gReserved1;
  2692.     long                            gReserved2;
  2693.     long                            gReserved3;
  2694.     long                            clientData;
  2695.     Ptr                                getBuffer;                    /*  --> */
  2696.     unsigned long                    getBufferSize;                /*  --> */
  2697.     long                            cReserved;                    /*  --  */
  2698. };
  2699. typedef struct DirNetSearchADAPDirectoriesGetPB DirNetSearchADAPDirectoriesGetPB;
  2700.  
  2701. typedef pascal Boolean (*ForEachADAPDirectoryProcPtr)(long clientData, const DirectoryName *dirName, const DirDiscriminator *discriminator, DirGestalt features, AddrBlock serverHint);
  2702.  
  2703. #if GENERATINGCFM
  2704. typedef UniversalProcPtr ForEachADAPDirectoryUPP;
  2705. #else
  2706. typedef ForEachADAPDirectoryProcPtr ForEachADAPDirectoryUPP;
  2707. #endif
  2708.  
  2709. typedef ForEachADAPDirectoryUPP ForEachADAPDirectory;
  2710.  
  2711. /*
  2712. DirNetSearchADAPDirectoriesParse:
  2713. This call can be used to extract the results obtained in the 'getBuffer'.
  2714. The directoryName, directoryDiscriminator, features and
  2715. serverHint (AppleTalk address for a PathFinder serving that catalog) are
  2716. returned in each call-back. These values may be used to make an
  2717. AddADAPDirectory call.
  2718.  
  2719. Returning TRUE from any call-back will terminate the NetSearchADAPDirectoriesParse request.
  2720.  
  2721. For synchronous calls, the call-back routine actually runs as part of the same thread
  2722. of execution as the thread that made the DirNetSearchADAPDirectoriesParse call. That means that the
  2723. same low-memory globals, A5, stack, etc. are in effect during the call-back
  2724. that were in effect when the call was made.  Because of this, the call-back
  2725. routine has the same restrictions as the caller of DirNetSearchADAPDirectoriesParse:
  2726. if DirNetSearchADAPDirectoriesParse was not called from interrupt level, then the call-
  2727. back routine can allocate memory. For asynchronous calls, call-back routine is
  2728. like a ioCompletion except that A5 will be preserved for the application.
  2729. */
  2730. struct DirNetSearchADAPDirectoriesParsePB {
  2731.     Ptr                                qLink;
  2732.     long                            reserved1;
  2733.     long                            reserved2;
  2734.     DirIOCompletionUPP                ioCompletion;
  2735.     OSErr                            ioResult;
  2736.     unsigned long                    saveA5;
  2737.     short                            reqCode;
  2738.     long                            reserved[2];
  2739.     AddrBlock                        serverHint;
  2740.     short                            dsRefNum;
  2741.     unsigned long                    callID;
  2742.     AuthIdentity                    identity;
  2743.     long                            gReserved1;
  2744.     long                            gReserved2;
  2745.     long                            gReserved3;
  2746.     long                            clientData;
  2747.     Ptr                                getBuffer;                    /*  --> */
  2748.     unsigned long                    getBufferSize;                /*  --> */
  2749.     ForEachADAPDirectory            eachADAPDirectory;            /*  --> */
  2750. };
  2751. typedef struct DirNetSearchADAPDirectoriesParsePB DirNetSearchADAPDirectoriesParsePB;
  2752.  
  2753. /*
  2754. DirFindADAPDirectoryByNetSearch:
  2755. This call can be used to make a network wide search to find an ADAP catalog.
  2756. This call will be supported only by 'ADAP' and involves highly expensive
  2757. network operations, so the user is advised to use utmost discretion before
  2758. making this call. The catalog is specified using directoryName and discriminator.
  2759. If 'addToOCESetup' is true, the catalog will be automatically added to the setup
  2760. list and will be visible through the EnumerateDirectories call and also
  2761. also a creationID to the directoryRecord will be returned.
  2762. If this parameter is set to 'false', the catalog will be added to temporary list
  2763. and will be available for making other catalog service calls. The catalogs
  2764. which are not in the preference catalog list will not be visible through the
  2765. EnumerateDirectories call.
  2766. */
  2767. struct DirFindADAPDirectoryByNetSearchPB {
  2768.     Ptr                                qLink;
  2769.     long                            reserved1;
  2770.     long                            reserved2;
  2771.     DirIOCompletionUPP                ioCompletion;
  2772.     OSErr                            ioResult;
  2773.     unsigned long                    saveA5;
  2774.     short                            reqCode;
  2775.     long                            reserved[2];
  2776.     AddrBlock                        serverHint;
  2777.     short                            dsRefNum;
  2778.     unsigned long                    callID;
  2779.     AuthIdentity                    identity;
  2780.     long                            gReserved1;
  2781.     long                            gReserved2;
  2782.     long                            gReserved3;
  2783.     long                            clientData;
  2784.     DirectoryNamePtr                directoryName;                /*  --> catalog name */
  2785.     DirDiscriminator                discriminator;                /*  --> discriminate between dup catalog names */
  2786.     Boolean                            addToOCESetup;                /*  --> add this catalog to OCE Setup List */
  2787.     Byte                            padByte;
  2788.     CreationID                        directoryRecordCID;            /* <--  creationID for the catalog record */
  2789. };
  2790. typedef struct DirFindADAPDirectoryByNetSearchPB DirFindADAPDirectoryByNetSearchPB;
  2791.  
  2792. /*
  2793. DirAddADAPDirectory:
  2794. The catalog specified by 'directoryName' and 'discriminator' will be
  2795. added to the list of catalogs maintained by the Toolbox. Once added,
  2796. the catalog is available across boots, until the catalog is removed
  2797. explicitly through a DirRemoveADAPDirectory call.
  2798. If 'serverHint' is not nil, the address provided will be used
  2799. to contact a PathFinder for the catalog specified.
  2800. If 'serverHint' is nil or does not point to a valid PathFinder server
  2801. for that catalog, this call will fail.
  2802. If 'addToOCESetup' is true, the catalog will be automatically added to the setup
  2803. catalog list and will be visible through EnumerateDirectories calls and
  2804. also a creationID to the directoryRecord will be returned.
  2805. If this parameter is set to 'false', catalog will be added to temprary list
  2806. and will be available for making other catalog service calls. The catalogs
  2807. which are not in the setup  list will not be visible through
  2808. EnumerateDirectories call.
  2809. */
  2810. struct DirAddADAPDirectoryPB {
  2811.     Ptr                                qLink;
  2812.     long                            reserved1;
  2813.     long                            reserved2;
  2814.     DirIOCompletionUPP                ioCompletion;
  2815.     OSErr                            ioResult;
  2816.     unsigned long                    saveA5;
  2817.     short                            reqCode;
  2818.     long                            reserved[2];
  2819.     AddrBlock                        serverHint;
  2820.     short                            dsRefNum;
  2821.     unsigned long                    callID;
  2822.     AuthIdentity                    identity;
  2823.     long                            gReserved1;
  2824.     long                            gReserved2;
  2825.     long                            gReserved3;
  2826.     long                            clientData;
  2827.     DirectoryNamePtr                directoryName;                /*  --> catalog name */
  2828.     DirDiscriminator                discriminator;                /*  --> discriminate between dup catalog names */
  2829.     Boolean                            addToOCESetup;                /*  --> add this catalog to OCE Setup */
  2830.     Byte                            padByte;
  2831.     CreationID                        directoryRecordCID;            /* <--  creationID for the catalog record */
  2832. };
  2833. typedef struct DirAddADAPDirectoryPB DirAddADAPDirectoryPB;
  2834.  
  2835. /*
  2836. GetDirectoryInfo:
  2837. DirGetDirectoryInfo will do:
  2838.  
  2839. If a 'dsRefNum' is non-Zero, the catalog information for
  2840.     the corresponding  PAB will be  returned.
  2841.  If 'dsRefNum' is zero and 'serverHint' is non-zero, If the
  2842.  'serverHint' points to a valid ADAP Catalog Server(Path Finder),
  2843.  the catalog information (i.e. directoryName, discriminator, features)
  2844.  for that catalog will be returned.
  2845.     If a  valid catalog name and discriminator are provided
  2846.     features (Set of capability flags) for that catalog will be returned.
  2847. */
  2848. struct DirGetDirectoryInfoPB {
  2849.     Ptr                                qLink;
  2850.     long                            reserved1;
  2851.     long                            reserved2;
  2852.     DirIOCompletionUPP                ioCompletion;
  2853.     OSErr                            ioResult;
  2854.     unsigned long                    saveA5;
  2855.     short                            reqCode;
  2856.     long                            reserved[2];
  2857.     AddrBlock                        serverHint;
  2858.     short                            dsRefNum;
  2859.     unsigned long                    callID;
  2860.     AuthIdentity                    identity;
  2861.     long                            gReserved1;
  2862.     long                            gReserved2;
  2863.     long                            gReserved3;
  2864.     long                            clientData;
  2865.     DirectoryNamePtr                directoryName;                /*  --> catalog name */
  2866.     DirDiscriminator                discriminator;                /* <--> descriminate between dup catalog names */
  2867.     DirGestalt                        features;                    /* <--  capability bit flags */
  2868. };
  2869. typedef struct DirGetDirectoryInfoPB DirGetDirectoryInfoPB;
  2870.  
  2871. /*
  2872.  * Note on Access Controls:
  2873.  * Access control is based on a list model.
  2874.  * You can get access controls list which gives dsObject and accMask for each dsObject.
  2875.  * GetAccessControl can be limited to currently supplied identity by setting forCurrentUserOnly.
  2876.  * There are special DSObjects are defined in ADASTypes.h for each of the category
  2877.  * supported in ADAS Catalogs. (kOwner, kFriends, kAuthenticatedToCluster, 
  2878.  * kAuthenticatedToDirectory, kGuest) and DUGetActlDSSpec call can be used
  2879.  * to obtain appropraiate DSSpec before making set calls to ADAS catalogs.
  2880.  *
  2881.  */
  2882. /*
  2883.     GetDNodeAccessControlGet:
  2884.     This call can be done to get back access control list for a DNode.
  2885.     pRLI -> RLI of the DNode whose access control list is sought
  2886.     curUserAccMask -> If this is 'true', Access controls for the user specified by
  2887.                       the identity parameter will be returned other wise entire list
  2888.                       will be returned.
  2889.     startingDsObj  -> If this is not nil, list should be started after this object.
  2890.     startingPointInclusive -> If staringDsObj is specified, include that in the returned
  2891.                               results.
  2892.                               
  2893.     The results will be collected in the 'getBuffer' supplied by the user.
  2894.     If buffer can not hold all the data returned 'daMoreData' error will be returned.
  2895.      
  2896.     If user receives 'noErr' or 'daMoreData', buffer will contain valid results. A user
  2897.     can extract the results in the 'getBuffer' by making 'DsGetDNodeAccessControlParse' call.
  2898.     
  2899.     Results returned for each DSObject will contain DSSpecPtr and three sets of access mask. 
  2900.  
  2901. */
  2902. struct DirGetDNodeAccessControlGetPB {
  2903.     Ptr                                qLink;
  2904.     long                            reserved1;
  2905.     long                            reserved2;
  2906.     DirIOCompletionUPP                ioCompletion;
  2907.     OSErr                            ioResult;
  2908.     unsigned long                    saveA5;
  2909.     short                            reqCode;
  2910.     long                            reserved[2];
  2911.     AddrBlock                        serverHint;
  2912.     short                            dsRefNum;
  2913.     unsigned long                    callID;
  2914.     AuthIdentity                    identity;
  2915.     long                            gReserved1;
  2916.     long                            gReserved2;
  2917.     long                            gReserved3;
  2918.     long                            clientData;
  2919.     PackedRLIPtr                    pRLI;                        /*  -> RLI of the cluster whose access control list is sought  */
  2920.     long                            bReserved;                    /*  -- unused */
  2921.     long                            cReserved;                    /*  -- unused */
  2922.     long                            dReserved;                    /*  -- unused */
  2923.     long                            eResreved;                    /* --> */
  2924.     Boolean                            forCurrentUserOnly;            /* -->  */
  2925.     Boolean                            filler1;
  2926.     DSSpec                            *startingPoint;                /* --> starting Point */
  2927.     Boolean                            includeStartingPoint;        /*  -> if true return the DsObject 
  2928.                                                                 specified in starting point */
  2929.     Boolean                            filler2;
  2930.     Ptr                                getBuffer;                    /*    -> */
  2931.     unsigned long                    getBufferSize;                /*  -> */
  2932. };
  2933. typedef struct DirGetDNodeAccessControlGetPB DirGetDNodeAccessControlGetPB;
  2934.  
  2935. /* The Access Control call-back function is defined as follows: */
  2936. typedef pascal Boolean (*ForEachDNodeAccessControlProcPtr)(long clientData, const DSSpec *dsObj, AccessMask activeDnodeAccMask, AccessMask defaultRecordAccMask, AccessMask defaultAttributeAccMask);
  2937.  
  2938. #if GENERATINGCFM
  2939. typedef UniversalProcPtr ForEachDNodeAccessControlUPP;
  2940. #else
  2941. typedef ForEachDNodeAccessControlProcPtr ForEachDNodeAccessControlUPP;
  2942. #endif
  2943.  
  2944. typedef ForEachDNodeAccessControlUPP ForEachDNodeAccessControl;
  2945.  
  2946. /*
  2947.     GetDNodeAccessControlParse:
  2948.     After an GetDNodeAccessControlGet call has completed, 
  2949.     call GetDNodeAccessControlParse to parse through the buffer that
  2950.     that was filled in GetDNodeAccessControlGet.
  2951.     
  2952.     'eachObject' will be called each time to return to the client a
  2953.     DsObject and a set of three accMasks (three long words) for that object.
  2954.     Acceesmasks returned apply to the dsObject in the callback :
  2955.     1. Currently Active Access mask for the specified DNode.
  2956.     2. Default Access mask for any Record in the DNode
  2957.     3. Default Access mask for any Attribute in the DNode
  2958.     The clientData parameter that you pass in the parameter block will be passed
  2959.     to 'eachObject'.  You are free to put anything in clientData - it is intended
  2960.     to allow you some way to match the call-back to the original call (for
  2961.     example, you make more then one aysynchronous GetDNodeAccessControlGet calls and you want to
  2962.     associate returned results in some way).
  2963.     
  2964.     The client should return FALSE from 'eachObject' to continue
  2965.     processing of the GetDNodeAccessControlParse request.  Returning TRUE will
  2966.     terminate the GetDNodeAccessControlParse request.
  2967.  
  2968.     For synchronous calls, the call-back routine actually runs as part of the same thread 
  2969.     of execution as the thread that made the GetDNodeAccessControlParse call.  That means that the
  2970.     same low-memory globals, A5, stack, etc. are in effect during the call-back
  2971.     that were in effect when the call was made.  Because of this, the call-back
  2972.     routine has the same restrictions as the caller of GetDNodeAccessControlParse:
  2973.     if GetDNodeAccessControlParse was not called from interrupt level, then the call-
  2974.     back routine can allocate memory. For asynchronous calls, call-back routine is
  2975.     like a ioCompletion except that A5 will be preserved for the application.
  2976.  
  2977.  
  2978. */
  2979. struct DirGetDNodeAccessControlParsePB {
  2980.     Ptr                                qLink;
  2981.     long                            reserved1;
  2982.     long                            reserved2;
  2983.     DirIOCompletionUPP                ioCompletion;
  2984.     OSErr                            ioResult;
  2985.     unsigned long                    saveA5;
  2986.     short                            reqCode;
  2987.     long                            reserved[2];
  2988.     AddrBlock                        serverHint;
  2989.     short                            dsRefNum;
  2990.     unsigned long                    callID;
  2991.     AuthIdentity                    identity;
  2992.     long                            gReserved1;
  2993.     long                            gReserved2;
  2994.     long                            gReserved3;
  2995.     long                            clientData;
  2996.     PackedRLIPtr                    pRLI;                        /*  -> RLI of the cluster  */
  2997.     long                            bReserved;                    /*  -- unused */
  2998.     long                            cReserved;                    /*  -- unused */
  2999.     long                            dReserved;                    /*  -- unused */
  3000.     ForEachDNodeAccessControl        eachObject;                    /* --> */
  3001.     Boolean                            forCurrentUserOnly;            /* -->  */
  3002.     Boolean                            filler1;
  3003.     DSSpec                            *startingPoint;                /* --> starting Point */
  3004.     Boolean                            includeStartingPoint;        /*  -> if true return the record 
  3005.                                                         specified in starting point */
  3006.     Boolean                            filler2;
  3007.     Ptr                                getBuffer;                    /*    -> */
  3008.     unsigned long                    getBufferSize;                /*  -> */
  3009. };
  3010. typedef struct DirGetDNodeAccessControlParsePB DirGetDNodeAccessControlParsePB;
  3011.  
  3012. /*
  3013.     GetRecordAccessControlGet:
  3014.     This call can be done to get back access control list for a RecordID.
  3015.     aRecord -> RecordID to which access control list is sought
  3016.     curUserAccMask -> If this is 'true', Access controls for the user specified by
  3017.                       the identity parameter will be returned other wise entire list
  3018.                       will be returned.
  3019.     startingDsObj  -> If this is not nil, list should be started after this object.
  3020.     startingPointInclusive -> If staringDsObj is specified, include that in the returned
  3021.                               results.
  3022.                               
  3023.     The results will be collected in the 'getBuffer' supplied by the user.
  3024.     If buffer can not hold all the data returned 'daMoreData' error will be returned.
  3025.      
  3026.     If user receives 'noErr' or 'daMoreData', buffer will contain valid results. A user
  3027.     can extract the results in the 'getBuffer' by making 'DsGetDNodeAccessControlParse' call.
  3028.     
  3029.     Results returned for each DSObject will contain DSSpecPtr and accMask. 
  3030.  
  3031. */
  3032. struct DirGetRecordAccessControlGetPB {
  3033.     Ptr                                qLink;
  3034.     long                            reserved1;
  3035.     long                            reserved2;
  3036.     DirIOCompletionUPP                ioCompletion;
  3037.     OSErr                            ioResult;
  3038.     unsigned long                    saveA5;
  3039.     short                            reqCode;
  3040.     long                            reserved[2];
  3041.     AddrBlock                        serverHint;
  3042.     short                            dsRefNum;
  3043.     unsigned long                    callID;
  3044.     AuthIdentity                    identity;
  3045.     long                            gReserved1;
  3046.     long                            gReserved2;
  3047.     long                            gReserved3;
  3048.     long                            clientData;
  3049.     RecordIDPtr                        aRecord;                    /*  -> RecordID to which access control list is sought list is sought  */
  3050.     long                            bReserved;                    /*  -- unused */
  3051.     long                            cReserved;                    /*  -- unused */
  3052.     long                            dReserved;                    /*  -- unused */
  3053.     long                            eResreved;                    /* --> */
  3054.     Boolean                            forCurrentUserOnly;            /* -->  */
  3055.     Boolean                            filler1;
  3056.     DSSpec                            *startingPoint;                /* --> starting Point */
  3057.     Boolean                            includeStartingPoint;        /*  -> if true return the DsObject 
  3058.                                                                 specified in starting point */
  3059.     Boolean                            filler2;
  3060.     Ptr                                getBuffer;                    /*    -> */
  3061.     unsigned long                    getBufferSize;                /*  -> */
  3062. };
  3063. typedef struct DirGetRecordAccessControlGetPB DirGetRecordAccessControlGetPB;
  3064.  
  3065. /* The Access Control call-back function is defined as follows: */
  3066. typedef pascal Boolean (*ForEachRecordAccessControlProcPtr)(long clientData, const DSSpec *dsObj, AccessMask activeDnodeAccMask, AccessMask activeRecordAccMask, AccessMask defaultAttributeAccMask);
  3067.  
  3068. #if GENERATINGCFM
  3069. typedef UniversalProcPtr ForEachRecordAccessControlUPP;
  3070. #else
  3071. typedef ForEachRecordAccessControlProcPtr ForEachRecordAccessControlUPP;
  3072. #endif
  3073.  
  3074. typedef ForEachRecordAccessControlUPP ForEachRecordAccessControl;
  3075.  
  3076. /*
  3077.     GetRecordAccessControlParse:
  3078.     After an GetRecordAccessControlGet call has completed, 
  3079.     call GetRecordAccessControlParse to parse through the buffer that
  3080.     that was filled in GetRecordAccessControlGet.
  3081.     
  3082.     'eachObject' will be called each time to return to the client a
  3083.     DsObject and a set of three accMasks (three long words) for that object.
  3084.     Acceesmasks returned apply to the dsObject in the callback :
  3085.     1. Active Access mask for the DNode Containing the Record.
  3086.     2. Active Access mask for the Record specified.
  3087.     3. Defualt Access mask for Attributes in the record.
  3088.     The clientData parameter that you pass in the parameter block will be passed
  3089.     to 'eachObject'.  You are free to put anything in clientData - it is intended
  3090.     to allow you some way to match the call-back to the original call (for
  3091.     example, you make more then one aysynchronous GetRecordAccessControlGet calls and you want to
  3092.     associate returned results in some way).
  3093.     
  3094.     The client should return FALSE from 'eachObject' to continue
  3095.     processing of the GetRecordAccessControlParse request.  Returning TRUE will
  3096.     terminate the GetRecordAccessControlParse request.
  3097.  
  3098.     For synchronous calls, the call-back routine actually runs as part of the same thread 
  3099.     of execution as the thread that made the GetRecordAccessControlParse call.  That means that the
  3100.     same low-memory globals, A5, stack, etc. are in effect during the call-back
  3101.     that were in effect when the call was made.  Because of this, the call-back
  3102.     routine has the same restrictions as the caller of GetRecordAccessControlParse:
  3103.     if GetRecordAccessControlParse was not called from interrupt level, then the call-
  3104.     back routine can allocate memory. For asynchronous calls, call-back routine is
  3105.     like a ioCompletion except that A5 will be preserved for the application.
  3106.  
  3107.  
  3108. */
  3109. struct DirGetRecordAccessControlParsePB {
  3110.     Ptr                                qLink;
  3111.     long                            reserved1;
  3112.     long                            reserved2;
  3113.     DirIOCompletionUPP                ioCompletion;
  3114.     OSErr                            ioResult;
  3115.     unsigned long                    saveA5;
  3116.     short                            reqCode;
  3117.     long                            reserved[2];
  3118.     AddrBlock                        serverHint;
  3119.     short                            dsRefNum;
  3120.     unsigned long                    callID;
  3121.     AuthIdentity                    identity;
  3122.     long                            gReserved1;
  3123.     long                            gReserved2;
  3124.     long                            gReserved3;
  3125.     long                            clientData;
  3126.     RecordIDPtr                        aRecord;                    /*  -> RecordID to which access control list is sought list is sought  */
  3127.     long                            bReserved;                    /*  -- unused */
  3128.     long                            cReserved;                    /*  -- unused */
  3129.     long                            dReserved;                    /*  -- unused */
  3130.     ForEachRecordAccessControl        eachObject;                    /* --> */
  3131.     Boolean                            forCurrentUserOnly;            /* -->  */
  3132.     Boolean                            filler1;
  3133.     DSSpec                            *startingPoint;                /* --> starting Point */
  3134.     Boolean                            includeStartingPoint;        /*  -> if true return the record 
  3135.                                                         specified in starting point */
  3136.     Boolean                            filler2;
  3137.     Ptr                                getBuffer;                    /*    -> */
  3138.     unsigned long                    getBufferSize;                /*  -> */
  3139. };
  3140. typedef struct DirGetRecordAccessControlParsePB DirGetRecordAccessControlParsePB;
  3141.  
  3142. /*
  3143.     GetAttributeAccessControlGet:
  3144.     This call can be done to get back access control list for a attributeType with in a RecordID.
  3145.     aRecord -> RecordID to which access control list is sought
  3146.     aType    -> Attribute Type to which access controls are sought
  3147.     curUserAccMask -> If this is 'true', Access controls for the user specified by
  3148.                       the identity parameter will be returned other wise entire list
  3149.                       will be returned.
  3150.     startingDsObj  -> If this is not nil, list should be started after this object.
  3151.     startingPointInclusive -> If staringDsObj is specified, include that in the returned
  3152.                               results.
  3153.                               
  3154.     The results will be collected in the 'getBuffer' supplied by the user.
  3155.     If buffer can not hold all the data returned 'daMoreData' error will be returned.
  3156.      
  3157.     If user receives 'noErr' or 'daMoreData', buffer will contain valid results. A user
  3158.     can extract the results in the 'getBuffer' by making 'DsGetDNodeAccessControlParse' call.
  3159.     
  3160.     Results returned for each DSObject will contain DSSpecPtr and accMask. 
  3161.  
  3162. */
  3163. struct DirGetAttributeAccessControlGetPB {
  3164.     Ptr                                qLink;
  3165.     long                            reserved1;
  3166.     long                            reserved2;
  3167.     DirIOCompletionUPP                ioCompletion;
  3168.     OSErr                            ioResult;
  3169.     unsigned long                    saveA5;
  3170.     short                            reqCode;
  3171.     long                            reserved[2];
  3172.     AddrBlock                        serverHint;
  3173.     short                            dsRefNum;
  3174.     unsigned long                    callID;
  3175.     AuthIdentity                    identity;
  3176.     long                            gReserved1;
  3177.     long                            gReserved2;
  3178.     long                            gReserved3;
  3179.     long                            clientData;
  3180.     RecordIDPtr                        aRecord;                    /*  -> RecordID to which access control list is sought list is sought  */
  3181.     AttributeTypePtr                aType;                        /*  -> Attribute Type to which access controls are sought          */
  3182.     long                            cReserved;                    /*  -- unused */
  3183.     long                            dReserved;                    /*  -- unused */
  3184.     long                            eResreved;                    /* --> */
  3185.     Boolean                            forCurrentUserOnly;            /* -->  */
  3186.     Boolean                            filler1;
  3187.     DSSpec                            *startingPoint;                /* --> starting Point */
  3188.     Boolean                            includeStartingPoint;        /*  -> if true return the DsObject 
  3189.                                                                 specified in starting point */
  3190.     Boolean                            filler2;
  3191.     Ptr                                getBuffer;                    /*    -> */
  3192.     unsigned long                    getBufferSize;                /*  -> */
  3193. };
  3194. typedef struct DirGetAttributeAccessControlGetPB DirGetAttributeAccessControlGetPB;
  3195.  
  3196. /* The Access Control call-back function is defined as follows: */
  3197. typedef pascal Boolean (*ForEachAttributeAccessControlProcPtr)(long clientData, const DSSpec *dsObj, AccessMask activeDnodeAccMask, AccessMask activeRecordAccMask, AccessMask activeAttributeAccMask);
  3198.  
  3199. #if GENERATINGCFM
  3200. typedef UniversalProcPtr ForEachAttributeAccessControlUPP;
  3201. #else
  3202. typedef ForEachAttributeAccessControlProcPtr ForEachAttributeAccessControlUPP;
  3203. #endif
  3204.  
  3205. typedef ForEachAttributeAccessControlUPP ForEachAttributeAccessControl;
  3206.  
  3207. /*
  3208.     GetAttributeAccessControlParse:
  3209.     After an GetAttributeAccessControlGet call has completed, 
  3210.     call GetAttributeAccessControlParse to parse through the buffer that
  3211.     that was filled in GetAttributeAccessControlGet.
  3212.     
  3213.     'eachObject' will be called each time to return to the client a
  3214.     DsObject and a set of three accMasks (three long words) for that object.
  3215.     Acceesmasks returned apply to the dsObject in the callback :
  3216.     1. Active Access mask for the DNode Containing the Attribute.
  3217.     2. Active Access mask for the Record in the Containing the Attribute.
  3218.     3. Active Access mask for the specified Attribute.
  3219.     The clientData parameter that you pass in the parameter block will be passed
  3220.     to 'eachObject'.  You are free to put anything in clientData - it is intended
  3221.     to allow you some way to match the call-back to the original call (for
  3222.     example, you make more then one aysynchronous GetAttributeAccessControlGet calls and you want to
  3223.     associate returned results in some way).
  3224.     
  3225.     The client should return FALSE from 'eachObject' to continue
  3226.     processing of the GetAttributeAccessControlParse request.  Returning TRUE will
  3227.     terminate the GetAttributeAccessControlParse request.
  3228.  
  3229.     For synchronous calls, the call-back routine actually runs as part of the same thread 
  3230.     of execution as the thread that made the GetAttributeAccessControlParse call.  That means that the
  3231.     same low-memory globals, A5, stack, etc. are in effect during the call-back
  3232.     that were in effect when the call was made.  Because of this, the call-back
  3233.     routine has the same restrictions as the caller of GetAttributeAccessControlParse:
  3234.     if GetAttributeAccessControlParse was not called from interrupt level, then the call-
  3235.     back routine can allocate memory. For asynchronous calls, call-back routine is
  3236.     like a ioCompletion except that A5 will be preserved for the application.
  3237.  
  3238.  
  3239. */
  3240. struct DirGetAttributeAccessControlParsePB {
  3241.     Ptr                                qLink;
  3242.     long                            reserved1;
  3243.     long                            reserved2;
  3244.     DirIOCompletionUPP                ioCompletion;
  3245.     OSErr                            ioResult;
  3246.     unsigned long                    saveA5;
  3247.     short                            reqCode;
  3248.     long                            reserved[2];
  3249.     AddrBlock                        serverHint;
  3250.     short                            dsRefNum;
  3251.     unsigned long                    callID;
  3252.     AuthIdentity                    identity;
  3253.     long                            gReserved1;
  3254.     long                            gReserved2;
  3255.     long                            gReserved3;
  3256.     long                            clientData;
  3257.     RecordIDPtr                        aRecord;                    /*  -> RecordID to which access control list is sought list is sought  */
  3258.     AttributeTypePtr                aType;                        /*  -> Attribute Type to which access controls are sought          */
  3259.     long                            cReserved;                    /*  -- unused */
  3260.     long                            dReserved;                    /*  -- unused */
  3261.     ForEachAttributeAccessControl    eachObject;                    /* --> */
  3262.     Boolean                            forCurrentUserOnly;            /* -->  */
  3263.     Boolean                            filler1;
  3264.     DSSpec                            *startingPoint;                /* --> starting Point */
  3265.     Boolean                            includeStartingPoint;        /*  -> if true return the record 
  3266.                                                         specified in starting point */
  3267.     Boolean                            filler2;
  3268.     Ptr                                getBuffer;                    /*    -> */
  3269.     unsigned long                    getBufferSize;                /*  -> */
  3270. };
  3271. typedef struct DirGetAttributeAccessControlParsePB DirGetAttributeAccessControlParsePB;
  3272.  
  3273. /*
  3274. MapPathNameToDNodeNumber:
  3275. This call maps a given PathName within a catalog to its DNodeNumber.
  3276. */
  3277. struct DirMapPathNameToDNodeNumberPB {
  3278.     Ptr                                qLink;
  3279.     long                            reserved1;
  3280.     long                            reserved2;
  3281.     DirIOCompletionUPP                ioCompletion;
  3282.     OSErr                            ioResult;
  3283.     unsigned long                    saveA5;
  3284.     short                            reqCode;
  3285.     long                            reserved[2];
  3286.     AddrBlock                        serverHint;
  3287.     short                            dsRefNum;
  3288.     unsigned long                    callID;
  3289.     AuthIdentity                    identity;
  3290.     long                            gReserved1;
  3291.     long                            gReserved2;
  3292.     long                            gReserved3;
  3293.     long                            clientData;
  3294.     DirectoryNamePtr                directoryName;                /*  --> catalog name */
  3295.     DirDiscriminator                discriminator;                /*  --> discriminator */
  3296.     DNodeNum                        dNodeNumber;                /* <--  dNodenumber to the path */
  3297.     PackedPathNamePtr                path;                        /*  --> Path Name to be mapped */
  3298. };
  3299. typedef struct DirMapPathNameToDNodeNumberPB DirMapPathNameToDNodeNumberPB;
  3300.  
  3301. /*
  3302. PathName in the path field will be mapped to the cooresponding dNodeNumber and
  3303. returned in the DNodeNumber field. directoryName and descriminator Fields are
  3304. ignored. DSRefNum is used to identify the catalog.
  3305. */
  3306. /*
  3307. MapDNodeNumberToPathName:
  3308. This call will map a given DNodeNumber with in a catalog to the
  3309. corresponding PathName.
  3310. */
  3311. struct DirMapDNodeNumberToPathNamePB {
  3312.     Ptr                                qLink;
  3313.     long                            reserved1;
  3314.     long                            reserved2;
  3315.     DirIOCompletionUPP                ioCompletion;
  3316.     OSErr                            ioResult;
  3317.     unsigned long                    saveA5;
  3318.     short                            reqCode;
  3319.     long                            reserved[2];
  3320.     AddrBlock                        serverHint;
  3321.     short                            dsRefNum;
  3322.     unsigned long                    callID;
  3323.     AuthIdentity                    identity;
  3324.     long                            gReserved1;
  3325.     long                            gReserved2;
  3326.     long                            gReserved3;
  3327.     long                            clientData;
  3328.     DirectoryNamePtr                directoryName;                /*  --> catalog name */
  3329.     DirDiscriminator                discriminator;                /*  --> discriminator */
  3330.     DNodeNum                        dNodeNumber;                /*  --> dNodenumber to be mapped */
  3331.     PackedPathNamePtr                path;                        /* <--  Packed Path Name returned */
  3332.     unsigned short                    lengthOfPathName;            /*  --> length of packed pathName structure*/
  3333. };
  3334. typedef struct DirMapDNodeNumberToPathNamePB DirMapDNodeNumberToPathNamePB;
  3335.  
  3336. /*
  3337. dNodeNumber in the DNodeNumber field will be mapped to the cooresponding
  3338. pathName and returned in the PackedPathName field.
  3339. lengthOfPathName is to be set the length of pathName structure.
  3340. If length of PackedPathName is larger then the lengthOfPathName, kOCEMoreData
  3341. OSErr will be returned.
  3342. */
  3343. /*
  3344. GetLocalNetworkSpec:
  3345. This call will return the Local NetworkSpec. Client should supply
  3346. an RString big enough to hold the NetworkSpec.
  3347. */
  3348. struct DirGetLocalNetworkSpecPB {
  3349.     Ptr                                qLink;
  3350.     long                            reserved1;
  3351.     long                            reserved2;
  3352.     DirIOCompletionUPP                ioCompletion;
  3353.     OSErr                            ioResult;
  3354.     unsigned long                    saveA5;
  3355.     short                            reqCode;
  3356.     long                            reserved[2];
  3357.     AddrBlock                        serverHint;
  3358.     short                            dsRefNum;
  3359.     unsigned long                    callID;
  3360.     AuthIdentity                    identity;
  3361.     long                            gReserved1;
  3362.     long                            gReserved2;
  3363.     long                            gReserved3;
  3364.     long                            clientData;
  3365.     DirectoryNamePtr                directoryName;                /*  --> catalog name */
  3366.     DirDiscriminator                discriminator;                /*  --> discriminator */
  3367.     NetworkSpecPtr                    networkSpec;                /* <--  NetworkSpec */
  3368. };
  3369. typedef struct DirGetLocalNetworkSpecPB DirGetLocalNetworkSpecPB;
  3370.  
  3371. /*
  3372. PathName in the path field must be set to nil. internetName should be large
  3373. enough to hold the internetName. InterNetname returned indicates path finder's
  3374. local internet (configured by administrator).
  3375. */
  3376. /*
  3377. GetDNodeInfo:
  3378. This call will return the information (internetName and descriptor)
  3379. for the given RLI of a DNode.
  3380. */
  3381. struct DirGetDNodeInfoPB {
  3382.     Ptr                                qLink;
  3383.     long                            reserved1;
  3384.     long                            reserved2;
  3385.     DirIOCompletionUPP                ioCompletion;
  3386.     OSErr                            ioResult;
  3387.     unsigned long                    saveA5;
  3388.     short                            reqCode;
  3389.     long                            reserved[2];
  3390.     AddrBlock                        serverHint;
  3391.     short                            dsRefNum;
  3392.     unsigned long                    callID;
  3393.     AuthIdentity                    identity;
  3394.     long                            gReserved1;
  3395.     long                            gReserved2;
  3396.     long                            gReserved3;
  3397.     long                            clientData;
  3398.     PackedRLIPtr                    pRLI;                        /*  --> packed RLI whose info is requested */
  3399.     DirNodeKind                        descriptor;                    /* <--  dNode descriptor */
  3400.     NetworkSpecPtr                    networkSpec;                /* <--  cluster's networkSpec if kIsCluster */
  3401. };
  3402. typedef struct DirGetDNodeInfoPB DirGetDNodeInfoPB;
  3403.  
  3404. /*
  3405. If DnodeNumber is set to a non zero value, path should be set to nil.
  3406. if DnodeNumber is set to zero, pathName should point to a packed path name.
  3407. internetName should be large enough to hold
  3408. the internetName. (If the internetName is same as the one got by
  3409. GetLocalInternetName call, it indicates cluster is reachable  without
  3410. forwarders, --> Tell me if I am wrong)
  3411. */
  3412. /*
  3413. DirCreatePersonalDirectory:
  3414. A new  personal catalog can be created by specifying an FSSpec for
  3415. the file. If a file already exists dupFNErr will be returned. This call is
  3416. supported 'synchronous' mode only.
  3417. */
  3418. struct DirCreatePersonalDirectoryPB {
  3419.     Ptr                                qLink;
  3420.     long                            reserved1;
  3421.     long                            reserved2;
  3422.     DirIOCompletionUPP                ioCompletion;
  3423.     OSErr                            ioResult;
  3424.     unsigned long                    saveA5;
  3425.     short                            reqCode;
  3426.     long                            reserved[2];
  3427.     AddrBlock                        serverHint;
  3428.     short                            dsRefNum;
  3429.     unsigned long                    callID;
  3430.     AuthIdentity                    identity;
  3431.     long                            gReserved1;
  3432.     long                            gReserved2;
  3433.     long                            gReserved3;
  3434.     long                            clientData;
  3435.     FSSpecPtr                        fsSpec;                        /*  --> FSSpec for the Personal Catalog */
  3436.     OSType                            fdType;                        /*  --> file type for the Personal Catalog */
  3437.     OSType                            fdCreator;                    /*  --> file creator for the Personal Catalog */
  3438. };
  3439. typedef struct DirCreatePersonalDirectoryPB DirCreatePersonalDirectoryPB;
  3440.  
  3441. /*
  3442. DirOpenPersonalDirectory:
  3443. An existing personal catalog can be opened using this call.
  3444. User can specify the personal catalog by FSSpec for the AddressBook file.
  3445. 'accessRequested' field specifies open permissions. 'fsRdPerm'  & 'fsRdWrPerm'
  3446. are the only accepted open modes for the address book.
  3447. When the call completes successfully, a dsRefNum will be returned. The 'dsRefNum'
  3448. field is in the DSParamBlockHeader. In addittion 'accessGranted' indicates
  3449. actual permission with personal catalog is opened and 'features' indicate the capabilty flags
  3450. associated with the personal catalog.
  3451. This call is supported 'synchronous' mode only.
  3452. */
  3453. struct DirOpenPersonalDirectoryPB {
  3454.     Ptr                                qLink;
  3455.     long                            reserved1;
  3456.     long                            reserved2;
  3457.     DirIOCompletionUPP                ioCompletion;
  3458.     OSErr                            ioResult;
  3459.     unsigned long                    saveA5;
  3460.     short                            reqCode;
  3461.     long                            reserved[2];
  3462.     AddrBlock                        serverHint;
  3463.     short                            dsRefNum;
  3464.     unsigned long                    callID;
  3465.     AuthIdentity                    identity;
  3466.     long                            gReserved1;
  3467.     long                            gReserved2;
  3468.     long                            gReserved3;
  3469.     long                            clientData;
  3470.     FSSpecPtr                        fsSpec;                        /*  --> Open an existing Personal Catalog */
  3471.     char                            accessRequested;            /*  --> Open: permissions Requested(byte)*/
  3472.     char                            accessGranted;                /*  <-- Open: permissions (byte) (Granted)*/
  3473.     DirGestalt                        features;                    /* <--  features for Personal Catalog */
  3474. };
  3475. typedef struct DirOpenPersonalDirectoryPB DirOpenPersonalDirectoryPB;
  3476.  
  3477. /*
  3478. DirClosePersonalDirectory: This call lets a client close AddressBook opened by DirOpenPersonalDirectory.
  3479. The Personal Catalog specified by the 'dsRefNum' will be closed.
  3480. This call is supported 'synchronous' mode only.
  3481. */
  3482. struct DirClosePersonalDirectoryPB {
  3483.     Ptr                                qLink;
  3484.     long                            reserved1;
  3485.     long                            reserved2;
  3486.     DirIOCompletionUPP                ioCompletion;
  3487.     OSErr                            ioResult;
  3488.     unsigned long                    saveA5;
  3489.     short                            reqCode;
  3490.     long                            reserved[2];
  3491.     AddrBlock                        serverHint;
  3492.     short                            dsRefNum;
  3493.     unsigned long                    callID;
  3494.     AuthIdentity                    identity;
  3495.     long                            gReserved1;
  3496.     long                            gReserved2;
  3497.     long                            gReserved3;
  3498.     long                            clientData;
  3499. };
  3500. typedef struct DirClosePersonalDirectoryPB DirClosePersonalDirectoryPB;
  3501.  
  3502. /*
  3503. DirMakePersonalDirectoryRLI: With this call a client can make an RLI
  3504. for a Personal Catalog opened by DirOpenPersonalDirectory Call.
  3505. A packed RLI is created for the Personal Catalog specified by the 'dsRefNum'.
  3506. If a client has a need to make the AddressBook reference to persistent
  3507. acrross boots it should make use of this call. In the current implementaion
  3508. PackedRLI has an embeeded System7.0 'alias'. If in later time
  3509. If client has a need to make reference to the AddressBook, it must use
  3510. ADAPLibrary call 'DUExtractAlias' and resole the 'alias' to 'FSSpec' and
  3511. make DirOpenPersonalDirectory call to get a 'dsRefNum'.
  3512.   'fromFSSpec'            FSPecPtr from which relative alias to be created. If nil,
  3513.                         absolute alias is created.
  3514.  'pRLIBufferSize' indicates the size of buffer pointed by 'pRLI'
  3515.  'pRLISize'    indicates the actual length of 'pRLI'. If the call
  3516.                         fails with 'kOCEMoreData' error a client can reissue
  3517.                     this call with a larger buffer of this length.
  3518.   'pRLI' is pointer to the buffer in which 'PackedRLI' is
  3519.   returned.
  3520. This call is supported in 'synchronous' mode only.
  3521. */
  3522. struct DirMakePersonalDirectoryRLIPB {
  3523.     Ptr                                qLink;
  3524.     long                            reserved1;
  3525.     long                            reserved2;
  3526.     DirIOCompletionUPP                ioCompletion;
  3527.     OSErr                            ioResult;
  3528.     unsigned long                    saveA5;
  3529.     short                            reqCode;
  3530.     long                            reserved[2];
  3531.     AddrBlock                        serverHint;
  3532.     short                            dsRefNum;
  3533.     unsigned long                    callID;
  3534.     AuthIdentity                    identity;
  3535.     long                            gReserved1;
  3536.     long                            gReserved2;
  3537.     long                            gReserved3;
  3538.     long                            clientData;
  3539.     FSSpecPtr                        fromFSSpec;                    /*  --> FSSpec for creating relative alia */
  3540.     unsigned short                    pRLIBufferSize;                /*  --> Length of 'pRLI' buffer */
  3541.     unsigned short                    pRLISize;                    /* <--  Length of actual 'pRLI' */
  3542.     PackedRLIPtr                    pRLI;                        /* <--  pRLI for the specified AddressBook */
  3543. };
  3544. typedef struct DirMakePersonalDirectoryRLIPB DirMakePersonalDirectoryRLIPB;
  3545.  
  3546. /*****************************************************************************
  3547. The calls described below apply only for CSAM Drivers:
  3548.  
  3549. The following three calls provide capability to Install/Remove a CSAM at RunTime.
  3550.     DirAddDSAM
  3551.     DirRemoveDSAM
  3552.     DirInstantiateDSAM
  3553.  
  3554. The following two calls provide capability to Install/Remove a CSAM Catalog at RunTime.
  3555.     DirAddDSAMDirectory
  3556.     DirRemoveDirectory
  3557.  
  3558. DirGetDirectoryIcon call is used by clients to get any special icon associated
  3559. with a CSAM catalog.
  3560.  
  3561. *****************************************************************************/
  3562. /*
  3563. DirAddDSAM: This call can be used to inorm the availability of a CSAM file
  3564. after discovering the CSAM file.
  3565.     dsamName -> is generic CSAM name e.g. Untitled X.500 directory
  3566.     dsamSignature -> could be generic CSAM kind e.g. 'X500'.
  3567.     fsSpec -> is the FileSpec for the file containing CSAM resources.
  3568. If the call is successfull 'DSAMRecordCID' will be returned. If the
  3569. call returns 'daDSAMRecordCIDExists', record was already there and
  3570. 'dsamRecordCID' will be returned.
  3571. This call can be done only in synchronous mode.
  3572. */
  3573. struct DirAddDSAMPB {
  3574.     Ptr                                qLink;
  3575.     long                            reserved1;
  3576.     long                            reserved2;
  3577.     DirIOCompletionUPP                ioCompletion;
  3578.     OSErr                            ioResult;
  3579.     unsigned long                    saveA5;
  3580.     short                            reqCode;
  3581.     long                            reserved[2];
  3582.     AddrBlock                        serverHint;
  3583.     short                            dsRefNum;
  3584.     unsigned long                    callID;
  3585.     AuthIdentity                    identity;
  3586.     long                            gReserved1;
  3587.     long                            gReserved2;
  3588.     long                            gReserved3;
  3589.     long                            clientData;
  3590.     CreationID                        dsamRecordCID;                /* <--  CreationID for the CSAM record */
  3591.     RStringPtr                        dsamName;                    /*  --> CSAM name */
  3592.     OCEDirectoryKind                dsamKind;                    /*  --> CSAM kind */
  3593.     FSSpecPtr                        fsSpec;                        /*  --> FSSpec for the file containing CSAM */
  3594. };
  3595. typedef struct DirAddDSAMPB DirAddDSAMPB;
  3596.  
  3597. /*
  3598. DirInstantiateDSAM: This call should be used by the CSAM driver in response
  3599. Driver Open call to indicate the toolbox about the availability of the CSAM.
  3600.     dsamName -> is generic CSAM name e.g. Untitled X.500 directory
  3601.     dsamKind -> could be generic CSAM kind e.g. 'X500'.
  3602.     dsamData -> pointer to private DSAMData. This will be paased back to the CSAM
  3603.     when the CSAM functions (DSAMDirProc,DSAMDirParseProc, DSAMAuthProc) are called.
  3604.     CSAM should already be setup using DirAddDSAM call.
  3605.     DSAMDirProc -> This procedure will be called when  any catalog service
  3606.     call intended for the CSAM (other then parse calls)
  3607.     DSAMDirParseProc -> This procedure will be called when any of the parse calls
  3608.     are called.
  3609.     DSAMAuthProc -> This procedure will be called when any of the Authentication Calls
  3610.     are made to the CSAM. If the CSAM does not support authentication, this can be nil.
  3611. This call can be done only in synchronous mode.
  3612. */
  3613. typedef pascal OSErr (*DSAMDirProcPtr)(Ptr dsamData, DirParamBlockPtr paramBlock, Boolean async);
  3614.  
  3615. #if GENERATINGCFM
  3616. typedef UniversalProcPtr DSAMDirUPP;
  3617. #else
  3618. typedef DSAMDirProcPtr DSAMDirUPP;
  3619. #endif
  3620.  
  3621. typedef DSAMDirUPP DSAMDirProc;
  3622.  
  3623. typedef pascal OSErr (*DSAMDirParseProcPtr)(Ptr dsamData, DirParamBlockPtr paramBlock, Boolean async);
  3624.  
  3625. #if GENERATINGCFM
  3626. typedef UniversalProcPtr DSAMDirParseUPP;
  3627. #else
  3628. typedef DSAMDirParseProcPtr DSAMDirParseUPP;
  3629. #endif
  3630.  
  3631. typedef DSAMDirParseUPP DSAMDirParseProc;
  3632.  
  3633. typedef pascal OSErr (*DSAMAuthProcPtr)(Ptr dsamData, AuthParamBlockPtr pb, Boolean async);
  3634.  
  3635. #if GENERATINGCFM
  3636. typedef UniversalProcPtr DSAMAuthUPP;
  3637. #else
  3638. typedef DSAMAuthProcPtr DSAMAuthUPP;
  3639. #endif
  3640.  
  3641. typedef DSAMAuthUPP DSAMAuthProc;
  3642.  
  3643. struct DirInstantiateDSAMPB {
  3644.     Ptr                                qLink;
  3645.     long                            reserved1;
  3646.     long                            reserved2;
  3647.     DirIOCompletionUPP                ioCompletion;
  3648.     OSErr                            ioResult;
  3649.     unsigned long                    saveA5;
  3650.     short                            reqCode;
  3651.     long                            reserved[2];
  3652.     AddrBlock                        serverHint;
  3653.     short                            dsRefNum;
  3654.     unsigned long                    callID;
  3655.     AuthIdentity                    identity;
  3656.     long                            gReserved1;
  3657.     long                            gReserved2;
  3658.     long                            gReserved3;
  3659.     long                            clientData;
  3660.     RStringPtr                        dsamName;                    /*  --> dsamName name */
  3661.     OCEDirectoryKind                dsamKind;                    /*  --> DSAMKind */
  3662.     Ptr                                dsamData;                    /*  --> dsamData  */
  3663.     DSAMDirUPP                        dsamDirProc;                /*  --> of type DSAMDirProc: for catalog service calls */
  3664.     DSAMDirParseUPP                    dsamDirParseProc;            /*  --> of type DSAMDirParseProc: for catalog service parse calls */
  3665.     DSAMAuthUPP                        dsamAuthProc;                /*  --> of type DSAMAuthProc: for authetication service calls */
  3666. };
  3667. typedef struct DirInstantiateDSAMPB DirInstantiateDSAMPB;
  3668.  
  3669. /*
  3670. DirRemoveDSAM: This call can be used to remove  a CSAM file from the OCE Setup.
  3671.     dsamRecordCID -> is the creationID of the CSAM record.
  3672. This call can be made only in synchronous mode.
  3673. */
  3674. struct DirRemoveDSAMPB {
  3675.     Ptr                                qLink;
  3676.     long                            reserved1;
  3677.     long                            reserved2;
  3678.     DirIOCompletionUPP                ioCompletion;
  3679.     OSErr                            ioResult;
  3680.     unsigned long                    saveA5;
  3681.     short                            reqCode;
  3682.     long                            reserved[2];
  3683.     AddrBlock                        serverHint;
  3684.     short                            dsRefNum;
  3685.     unsigned long                    callID;
  3686.     AuthIdentity                    identity;
  3687.     long                            gReserved1;
  3688.     long                            gReserved2;
  3689.     long                            gReserved3;
  3690.     long                            clientData;
  3691.     CreationID                        dsamRecordCID;                /* <--  CreationID for the CSAM record */
  3692. };
  3693. typedef struct DirRemoveDSAMPB DirRemoveDSAMPB;
  3694.  
  3695. /*
  3696. DirAddDSAMDirectory: This call can be used to inorm the availability of a CSAM catalog.
  3697.     dsamRecordCID ->  recordID for the CSAM serving this catalog
  3698.     directoryName ->  name of the catalog
  3699.     discriminator -> discriminator for the catalog
  3700.     directoryRecordCID -> If the call is successful, creationID for the record will
  3701.                             be returned.
  3702. */
  3703. struct DirAddDSAMDirectoryPB {
  3704.     Ptr                                qLink;
  3705.     long                            reserved1;
  3706.     long                            reserved2;
  3707.     DirIOCompletionUPP                ioCompletion;
  3708.     OSErr                            ioResult;
  3709.     unsigned long                    saveA5;
  3710.     short                            reqCode;
  3711.     long                            reserved[2];
  3712.     AddrBlock                        serverHint;
  3713.     short                            dsRefNum;
  3714.     unsigned long                    callID;
  3715.     AuthIdentity                    identity;
  3716.     long                            gReserved1;
  3717.     long                            gReserved2;
  3718.     long                            gReserved3;
  3719.     long                            clientData;
  3720.     CreationID                        dsamRecordCID;                /*  --> CreationID for the CSAM record */
  3721.     DirectoryNamePtr                directoryName;                /*  --> catalog name */
  3722.     DirDiscriminator                discriminator;                /*  --> catalog discriminator */
  3723.     DirGestalt                        features;                    /*  --> capabilty flags for the catalog */
  3724.     CreationID                        directoryRecordCID;            /* <--  creationID for the catalog record */
  3725. };
  3726. typedef struct DirAddDSAMDirectoryPB DirAddDSAMDirectoryPB;
  3727.  
  3728. /*
  3729. DirRemoveDirectory: This call can be used to inform the toolbox that
  3730. catalog specified by 'directoryRecordCID'
  3731. */
  3732. struct DirRemoveDirectoryPB {
  3733.     Ptr                                qLink;
  3734.     long                            reserved1;
  3735.     long                            reserved2;
  3736.     DirIOCompletionUPP                ioCompletion;
  3737.     OSErr                            ioResult;
  3738.     unsigned long                    saveA5;
  3739.     short                            reqCode;
  3740.     long                            reserved[2];
  3741.     AddrBlock                        serverHint;
  3742.     short                            dsRefNum;
  3743.     unsigned long                    callID;
  3744.     AuthIdentity                    identity;
  3745.     long                            gReserved1;
  3746.     long                            gReserved2;
  3747.     long                            gReserved3;
  3748.     long                            clientData;
  3749.     CreationID                        directoryRecordCID;            /*  --> creationID for the catalog record */
  3750. };
  3751. typedef struct DirRemoveDirectoryPB DirRemoveDirectoryPB;
  3752.  
  3753. /*
  3754.  * DSGetExtendedDirectoriesInfo::  This call can be used to get
  3755.  * the information of various foreign catalogs supported.
  3756.  * Typically a DE Template  may make this call to create a
  3757.  * Address template or a Gateway may make this call to findout
  3758.  * catalog name space in which MSAM may would support. 
  3759.  * Client will supply a buffer pointed by 'bufferPtr' of size 'bufferLength'. 
  3760.  * When the call completes with 'daMoreData' error, client can examine 'totalEntries'
  3761.  * returned and reissue the call with increaing buffer.
  3762.  * Toolbox will findout the private information of each of the Foreign Catalogs
  3763.  * by polling CSAM's, Gateways, and MnMServers. The Information returned
  3764.  * for each catalog will be packed in the format: 
  3765.  * typedef struct EachDirectoryData {
  3766.  *  PackedRLI                        pRLI;           //  packed RLI for the catalog
  3767.  *  OSType                            entnType;        //  Entn Type
  3768.  *  long                            hasMailSlot;   //  If this catalog has mail slot this will be 1 otherwise zero
  3769.  *    ProtoRString                    RealName;      //  Packed RString for Real Name (padded to even boundary) 
  3770.  *    ProtoRString                    comment;       //  Packed RString holding any comment for Display (padded to even boundary)
  3771.  *    long                            length;        //  data length
  3772.  *    char                            data[length];  //  data padded to even boundary
  3773.  * };
  3774.  *
  3775.  *
  3776.  *
  3777.  * typedef struct myData {
  3778.  *      EachDirectoryData    data[numberOfEntries];    // data packed in the above format
  3779.  *    };
  3780.  *
  3781.  */
  3782. struct DirGetExtendedDirectoriesInfoPB {
  3783.     Ptr                                qLink;
  3784.     long                            reserved1;
  3785.     long                            reserved2;
  3786.     DirIOCompletionUPP                ioCompletion;
  3787.     OSErr                            ioResult;
  3788.     unsigned long                    saveA5;
  3789.     short                            reqCode;
  3790.     long                            reserved[2];
  3791.     AddrBlock                        serverHint;
  3792.     short                            dsRefNum;
  3793.     unsigned long                    callID;
  3794.     AuthIdentity                    identity;
  3795.     long                            gReserved1;
  3796.     long                            gReserved2;
  3797.     long                            gReserved3;
  3798.     long                            clientData;
  3799.     Ptr                                buffer;                        /*  --> Pointer to a buufer where data will be returned */
  3800.     unsigned long                    bufferSize;                    /*  --> Length of the buffer, Length of actual data will be returned here */
  3801.     unsigned long                    totalEntries;                /* <--  Total Number of Catalogs found */
  3802.     unsigned long                    actualEntries;                /* <--  Total Number of Catalogs entries returned */
  3803. };
  3804. typedef struct DirGetExtendedDirectoriesInfoPB DirGetExtendedDirectoriesInfoPB;
  3805.  
  3806. /*
  3807. DirGetDirectoryIconPB: With this call a client can find out about
  3808. the icons supported by the Catalog.
  3809. Both ADAP and Personal Catalog will not support this call for now.
  3810. A CSAM can support a call so that DE Extension can use this
  3811. call to find appropriate Icons.
  3812.  
  3813. Returns kOCEBufferTooSmall if icon is too small, but will update iconSize.
  3814. */
  3815. struct DirGetDirectoryIconPB {
  3816.     Ptr                                qLink;
  3817.     long                            reserved1;
  3818.     long                            reserved2;
  3819.     DirIOCompletionUPP                ioCompletion;
  3820.     OSErr                            ioResult;
  3821.     unsigned long                    saveA5;
  3822.     short                            reqCode;
  3823.     long                            reserved[2];
  3824.     AddrBlock                        serverHint;
  3825.     short                            dsRefNum;
  3826.     unsigned long                    callID;
  3827.     AuthIdentity                    identity;
  3828.     long                            gReserved1;
  3829.     long                            gReserved2;
  3830.     long                            gReserved3;
  3831.     long                            clientData;
  3832.     PackedRLIPtr                    pRLI;                        /*  --> packed RLI for the catalog */
  3833.     OSType                            iconType;                    /*  --> Type of Icon requested */
  3834.     Ptr                                iconBuffer;                    /*  --> Buffer to hold Icon Data */
  3835.     unsigned long                    bufferSize;                    /*  <-> size of buffer to hold icon data */
  3836. };
  3837. typedef struct DirGetDirectoryIconPB DirGetDirectoryIconPB;
  3838.  
  3839. /*
  3840. DirGetOCESetupRefNum: This call will return 'dsRefnum' for the OCE Setup Personal Catalog
  3841. and oceSetupRecordCID for the oceSetup Record.
  3842. Clients interested in manipulating OCE Setup Personal Catalog directly should
  3843. make this call to get 'dsRefNum'.
  3844. 'dsRefNum' will be returned in the standard field in the DirParamHeader.
  3845. */
  3846. struct DirGetOCESetupRefNumPB {
  3847.     Ptr                                qLink;
  3848.     long                            reserved1;
  3849.     long                            reserved2;
  3850.     DirIOCompletionUPP                ioCompletion;
  3851.     OSErr                            ioResult;
  3852.     unsigned long                    saveA5;
  3853.     short                            reqCode;
  3854.     long                            reserved[2];
  3855.     AddrBlock                        serverHint;
  3856.     short                            dsRefNum;
  3857.     unsigned long                    callID;
  3858.     AuthIdentity                    identity;
  3859.     long                            gReserved1;
  3860.     long                            gReserved2;
  3861.     long                            gReserved3;
  3862.     long                            clientData;
  3863.     CreationID                        oceSetupRecordCID;            /* --> creationID for the catalog record */
  3864. };
  3865. typedef struct DirGetOCESetupRefNumPB DirGetOCESetupRefNumPB;
  3866.  
  3867. /*****************************************************************************/
  3868. /* Catalog and Authentication control blocks and operation definitions */
  3869. union AuthParamBlock {
  3870.     struct {
  3871.         Ptr                                qLink;
  3872.         long                            reserved1;
  3873.         long                            reserved2;
  3874.         AuthIOCompletionUPP                ioCompletion;
  3875.         OSErr                            ioResult;
  3876.         unsigned long                    saveA5;
  3877.         short                            reqCode;
  3878.         long                            reserved[2];
  3879.         AddrBlock                        serverHint;
  3880.         short                            dsRefNum;
  3881.         unsigned long                    callID;
  3882.         AuthIdentity                    identity;
  3883.         long                            gReserved1;
  3884.         long                            gReserved2;
  3885.         long                            gReserved3;
  3886.         long                            clientData;
  3887.     }                                header;
  3888.     AuthBindSpecificIdentityPB        bindIdentityPB;
  3889.     AuthUnbindSpecificIdentityPB    unbindIdentityPB;
  3890.     AuthResolveCreationIDPB            resolveCreationIDPB;
  3891.     AuthGetSpecificIdentityInfoPB    getIdentityInfoPB;
  3892.     AuthAddKeyPB                    addKeyPB;
  3893.     AuthChangeKeyPB                    changeKeyPB;
  3894.     AuthDeleteKeyPB                    deleteKeyPB;
  3895.     AuthPasswordToKeyPB                passwordToKeyPB;
  3896.     AuthGetCredentialsPB            getCredentialsPB;
  3897.     AuthDecryptCredentialsPB        decryptCredentialsPB;
  3898.     AuthMakeChallengePB                makeChallengePB;
  3899.     AuthMakeReplyPB                    makeReplyPB;
  3900.     AuthVerifyReplyPB                verifyReplyPB;
  3901.     AuthGetUTCTimePB                getUTCTimePB;
  3902.     AuthMakeProxyPB                    makeProxyPB;
  3903.     AuthTradeProxyForCredentialsPB    tradeProxyForCredentialsPB;
  3904.     AuthGetLocalIdentityPB            getLocalIdentityPB;
  3905.     AuthUnlockLocalIdentityPB        unLockLocalIdentityPB;
  3906.     AuthLockLocalIdentityPB            lockLocalIdentityPB;
  3907.     AuthAddToLocalIdentityQueuePB    localIdentityQInstallPB;
  3908.     AuthRemoveFromLocalIdentityQueuePB localIdentityQRemovePB;
  3909.     AuthSetupLocalIdentityPB        setupLocalIdentityPB;
  3910.     AuthChangeLocalIdentityPB        changeLocalIdentityPB;
  3911.     AuthRemoveLocalIdentityPB        removeLocalIdentityPB;
  3912.     OCESetupAddDirectoryInfoPB        setupDirectoryIdentityPB;
  3913.     OCESetupChangeDirectoryInfoPB    changeDirectoryIdentityPB;
  3914.     OCESetupRemoveDirectoryInfoPB    removeDirectoryIdentityPB;
  3915.     OCESetupGetDirectoryInfoPB        getDirectoryIdentityInfoPB;
  3916. };
  3917. union DirParamBlock {
  3918.     struct {
  3919.         Ptr                                qLink;
  3920.         long                            reserved1;
  3921.         long                            reserved2;
  3922.         DirIOCompletionUPP                ioCompletion;
  3923.         OSErr                            ioResult;
  3924.         unsigned long                    saveA5;
  3925.         short                            reqCode;
  3926.         long                            reserved[2];
  3927.         AddrBlock                        serverHint;
  3928.         short                            dsRefNum;
  3929.         unsigned long                    callID;
  3930.         AuthIdentity                    identity;
  3931.         long                            gReserved1;
  3932.         long                            gReserved2;
  3933.         long                            gReserved3;
  3934.         long                            clientData;
  3935.     }                                header;
  3936.     DirAddRecordPB                    addRecordPB;
  3937.     DirDeleteRecordPB                deleteRecordPB;
  3938.     DirEnumerateGetPB                enumerateGetPB;
  3939.     DirEnumerateParsePB                enumerateParsePB;
  3940.     DirFindRecordGetPB                findRecordGetPB;
  3941.     DirFindRecordParsePB            findRecordParsePB;
  3942.     DirLookupGetPB                    lookupGetPB;
  3943.     DirLookupParsePB                lookupParsePB;
  3944.     DirAddAttributeValuePB            addAttributeValuePB;
  3945.     DirDeleteAttributeTypePB        deleteAttributeTypePB;
  3946.     DirDeleteAttributeValuePB        deleteAttributeValuePB;
  3947.     DirChangeAttributeValuePB        changeAttributeValuePB;
  3948.     DirVerifyAttributeValuePB        verifyAttributeValuePB;
  3949.     DirFindValuePB                    findValuePB;
  3950.     DirEnumeratePseudonymGetPB        enumeratePseudonymGetPB;
  3951.     DirEnumeratePseudonymParsePB    enumeratePseudonymParsePB;
  3952.     DirAddPseudonymPB                addPseudonymPB;
  3953.     DirDeletePseudonymPB            deletePseudonymPB;
  3954.     DirAddAliasPB                    addAliasPB;
  3955.     DirEnumerateAttributeTypesGetPB    enumerateAttributeTypesGetPB;
  3956.     DirEnumerateAttributeTypesParsePB enumerateAttributeTypesParsePB;
  3957.     DirGetNameAndTypePB                getNameAndTypePB;
  3958.     DirSetNameAndTypePB                setNameAndTypePB;
  3959.     DirGetRecordMetaInfoPB            getRecordMetaInfoPB;
  3960.     DirGetDNodeMetaInfoPB            getDNodeMetaInfoPB;
  3961.     DirGetDirectoryInfoPB            getDirectoryInfoPB;
  3962.     DirGetDNodeAccessControlGetPB    getDNodeAccessControlGetPB;
  3963.     DirGetDNodeAccessControlParsePB    getDNodeAccessControlParsePB;
  3964.     DirGetRecordAccessControlGetPB    getRecordAccessControlGetPB;
  3965.     DirGetRecordAccessControlParsePB getRecordAccessControlParsePB;
  3966.     DirGetAttributeAccessControlGetPB getAttributeAccessControlGetPB;
  3967.     DirGetAttributeAccessControlParsePB getAttributeAccessControlParsePB;
  3968.     DirEnumerateDirectoriesGetPB    enumerateDirectoriesGetPB;
  3969.     DirEnumerateDirectoriesParsePB    enumerateDirectoriesParsePB;
  3970.     DirAddADAPDirectoryPB            addADAPDirectoryPB;
  3971.     DirRemoveDirectoryPB            removeDirectoryPB;
  3972.     DirNetSearchADAPDirectoriesGetPB netSearchADAPDirectoriesGetPB;
  3973.     DirNetSearchADAPDirectoriesParsePB netSearchADAPDirectoriesParsePB;
  3974.     DirFindADAPDirectoryByNetSearchPB findADAPDirectoryByNetSearchPB;
  3975.     DirMapDNodeNumberToPathNamePB    mapDNodeNumberToPathNamePB;
  3976.     DirMapPathNameToDNodeNumberPB    mapPathNameToDNodeNumberPB;
  3977.     DirGetLocalNetworkSpecPB        getLocalNetworkSpecPB;
  3978.     DirGetDNodeInfoPB                getDNodeInfoPB;
  3979.     DirCreatePersonalDirectoryPB    createPersonalDirectoryPB;
  3980.     DirOpenPersonalDirectoryPB        openPersonalDirectoryPB;
  3981.     DirClosePersonalDirectoryPB        closePersonalDirectoryPB;
  3982.     DirMakePersonalDirectoryRLIPB    makePersonalDirectoryRLIPB;
  3983.     DirAddDSAMPB                    addDSAMPB;
  3984.     DirInstantiateDSAMPB            instantiateDSAMPB;
  3985.     DirRemoveDSAMPB                    removeDSAMPB;
  3986.     DirAddDSAMDirectoryPB            addDSAMDirectoryPB;
  3987.     DirGetExtendedDirectoriesInfoPB    getExtendedDirectoriesInfoPB;
  3988.     DirGetDirectoryIconPB            getDirectoryIconPB;
  3989.     DirGetOCESetupRefNumPB            dirGetOCESetupRefNumPB;
  3990.     DirAbortPB                        abortPB;
  3991. };
  3992. /*
  3993. pass kThisRecordOwnerMask, kFriendsMask, kAuthenticatedInDNodeMask, kAuthenticatedInDirectoryMask,
  3994. kGuestMask, or kMeMask to this routine, and it will return a pointer to a
  3995. DSSpec that can be used in the Get or Set Access Controls calls.
  3996. */
  3997. extern pascal DSSpec *OCEGetAccessControlDSSpec(CategoryMask categoryBitMask)
  3998.  THREEWORDINLINE(0x303C, 837, 0xAA5C);
  3999. enum {
  4000.     uppAuthIOCompletionProcInfo = kPascalStackBased
  4001.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(AuthParamBlockPtr))),
  4002.     uppNotificationProcInfo = kPascalStackBased
  4003.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4004.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4005.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(AuthLocalIdentityOp)))
  4006.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(AuthLocalIdentityLockAction)))
  4007.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(LocalIdentity))),
  4008.     uppDirIOCompletionProcInfo = kPascalStackBased
  4009.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DirParamBlockPtr))),
  4010.     uppForEachDirEnumSpecProcInfo = kPascalStackBased
  4011.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4012.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4013.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirEnumSpec*))),
  4014.     uppForEachRecordProcInfo = kPascalStackBased
  4015.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4016.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4017.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirEnumSpec*)))
  4018.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(PackedRLIPtr))),
  4019.     uppForEachLookupRecordIDProcInfo = kPascalStackBased
  4020.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4021.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4022.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(RecordID*))),
  4023.     uppForEachAttrTypeLookupProcInfo = kPascalStackBased
  4024.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4025.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4026.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(AttributeType*)))
  4027.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(AccessMask))),
  4028.     uppForEachAttrValueProcInfo = kPascalStackBased
  4029.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4030.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4031.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Attribute*))),
  4032.     uppForEachAttrTypeProcInfo = kPascalStackBased
  4033.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4034.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4035.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(AttributeType*))),
  4036.     uppForEachRecordIDProcInfo = kPascalStackBased
  4037.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4038.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4039.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(RecordID*))),
  4040.     uppForEachDirectoryProcInfo = kPascalStackBased
  4041.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4042.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4043.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirectoryName*)))
  4044.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(DirDiscriminator*)))
  4045.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(DirGestalt))),
  4046.     uppForEachADAPDirectoryProcInfo = kPascalStackBased
  4047.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4048.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4049.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirectoryName*)))
  4050.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(DirDiscriminator*)))
  4051.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(DirGestalt)))
  4052.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(AddrBlock))),
  4053.     uppForEachDNodeAccessControlProcInfo = kPascalStackBased
  4054.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4055.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4056.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DSSpec*)))
  4057.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(AccessMask)))
  4058.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(AccessMask)))
  4059.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(AccessMask))),
  4060.     uppForEachRecordAccessControlProcInfo = kPascalStackBased
  4061.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4062.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4063.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DSSpec*)))
  4064.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(AccessMask)))
  4065.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(AccessMask)))
  4066.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(AccessMask))),
  4067.     uppForEachAttributeAccessControlProcInfo = kPascalStackBased
  4068.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4069.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4070.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DSSpec*)))
  4071.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(AccessMask)))
  4072.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(AccessMask)))
  4073.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(AccessMask))),
  4074.     uppDSAMDirProcInfo = kPascalStackBased
  4075.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  4076.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  4077.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirParamBlockPtr)))
  4078.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean))),
  4079.     uppDSAMDirParseProcInfo = kPascalStackBased
  4080.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  4081.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  4082.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirParamBlockPtr)))
  4083.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean))),
  4084.     uppDSAMAuthProcInfo = kPascalStackBased
  4085.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  4086.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  4087.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(AuthParamBlockPtr)))
  4088.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean)))
  4089. };
  4090.  
  4091. #if GENERATINGCFM
  4092. #define CallAuthIOCompletionProc(userRoutine, paramBlock)        \
  4093.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppAuthIOCompletionProcInfo, (paramBlock))
  4094. #define CallNotificationProc(userRoutine, clientData, callValue, actionValue, identity)        \
  4095.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppNotificationProcInfo, (clientData), (callValue), (actionValue), (identity))
  4096. #define CallDirIOCompletionProc(userRoutine, paramBlock)        \
  4097.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDirIOCompletionProcInfo, (paramBlock))
  4098. #define CallForEachDirEnumSpecProc(userRoutine, clientData, enumSpec)        \
  4099.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachDirEnumSpecProcInfo, (clientData), (enumSpec))
  4100. #define CallForEachRecordProc(userRoutine, clientData, enumSpec, pRLI)        \
  4101.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachRecordProcInfo, (clientData), (enumSpec), (pRLI))
  4102. #define CallForEachLookupRecordIDProc(userRoutine, clientData, recordID)        \
  4103.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachLookupRecordIDProcInfo, (clientData), (recordID))
  4104. #define CallForEachAttrTypeLookupProc(userRoutine, clientData, attrType, myAttrAccMask)        \
  4105.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachAttrTypeLookupProcInfo, (clientData), (attrType), (myAttrAccMask))
  4106. #define CallForEachAttrValueProc(userRoutine, clientData, attribute)        \
  4107.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachAttrValueProcInfo, (clientData), (attribute))
  4108. #define CallForEachAttrTypeProc(userRoutine, clientData, attrType)        \
  4109.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachAttrTypeProcInfo, (clientData), (attrType))
  4110. #define CallForEachRecordIDProc(userRoutine, clientData, recordID)        \
  4111.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachRecordIDProcInfo, (clientData), (recordID))
  4112. #define CallForEachDirectoryProc(userRoutine, clientData, dirName, discriminator, features)        \
  4113.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachDirectoryProcInfo, (clientData), (dirName), (discriminator), (features))
  4114. #define CallForEachADAPDirectoryProc(userRoutine, clientData, dirName, discriminator, features, serverHint)        \
  4115.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachADAPDirectoryProcInfo, (clientData), (dirName), (discriminator), (features), (serverHint))
  4116. #define CallForEachDNodeAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, defaultRecordAccMask, defaultAttributeAccMask)        \
  4117.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachDNodeAccessControlProcInfo, (clientData), (dsObj), (activeDnodeAccMask), (defaultRecordAccMask), (defaultAttributeAccMask))
  4118. #define CallForEachRecordAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, activeRecordAccMask, defaultAttributeAccMask)        \
  4119.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachRecordAccessControlProcInfo, (clientData), (dsObj), (activeDnodeAccMask), (activeRecordAccMask), (defaultAttributeAccMask))
  4120. #define CallForEachAttributeAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, activeRecordAccMask, activeAttributeAccMask)        \
  4121.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachAttributeAccessControlProcInfo, (clientData), (dsObj), (activeDnodeAccMask), (activeRecordAccMask), (activeAttributeAccMask))
  4122. #define CallDSAMDirProc(userRoutine, dsamData, paramBlock, async)        \
  4123.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDSAMDirProcInfo, (dsamData), (paramBlock), (async))
  4124. #define CallDSAMDirParseProc(userRoutine, dsamData, paramBlock, async)        \
  4125.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDSAMDirParseProcInfo, (dsamData), (paramBlock), (async))
  4126. #define CallDSAMAuthProc(userRoutine, dsamData, pb, async)        \
  4127.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDSAMAuthProcInfo, (dsamData), (pb), (async))
  4128. #else
  4129. #define CallAuthIOCompletionProc(userRoutine, paramBlock)        \
  4130.         (*(userRoutine))((paramBlock))
  4131. #define CallNotificationProc(userRoutine, clientData, callValue, actionValue, identity)        \
  4132.         (*(userRoutine))((clientData), (callValue), (actionValue), (identity))
  4133. #define CallDirIOCompletionProc(userRoutine, paramBlock)        \
  4134.         (*(userRoutine))((paramBlock))
  4135. #define CallForEachDirEnumSpecProc(userRoutine, clientData, enumSpec)        \
  4136.         (*(userRoutine))((clientData), (enumSpec))
  4137. #define CallForEachRecordProc(userRoutine, clientData, enumSpec, pRLI)        \
  4138.         (*(userRoutine))((clientData), (enumSpec), (pRLI))
  4139. #define CallForEachLookupRecordIDProc(userRoutine, clientData, recordID)        \
  4140.         (*(userRoutine))((clientData), (recordID))
  4141. #define CallForEachAttrTypeLookupProc(userRoutine, clientData, attrType, myAttrAccMask)        \
  4142.         (*(userRoutine))((clientData), (attrType), (myAttrAccMask))
  4143. #define CallForEachAttrValueProc(userRoutine, clientData, attribute)        \
  4144.         (*(userRoutine))((clientData), (attribute))
  4145. #define CallForEachAttrTypeProc(userRoutine, clientData, attrType)        \
  4146.         (*(userRoutine))((clientData), (attrType))
  4147. #define CallForEachRecordIDProc(userRoutine, clientData, recordID)        \
  4148.         (*(userRoutine))((clientData), (recordID))
  4149. #define CallForEachDirectoryProc(userRoutine, clientData, dirName, discriminator, features)        \
  4150.         (*(userRoutine))((clientData), (dirName), (discriminator), (features))
  4151. #define CallForEachADAPDirectoryProc(userRoutine, clientData, dirName, discriminator, features, serverHint)        \
  4152.         (*(userRoutine))((clientData), (dirName), (discriminator), (features), (serverHint))
  4153. #define CallForEachDNodeAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, defaultRecordAccMask, defaultAttributeAccMask)        \
  4154.         (*(userRoutine))((clientData), (dsObj), (activeDnodeAccMask), (defaultRecordAccMask), (defaultAttributeAccMask))
  4155. #define CallForEachRecordAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, activeRecordAccMask, defaultAttributeAccMask)        \
  4156.         (*(userRoutine))((clientData), (dsObj), (activeDnodeAccMask), (activeRecordAccMask), (defaultAttributeAccMask))
  4157. #define CallForEachAttributeAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, activeRecordAccMask, activeAttributeAccMask)        \
  4158.         (*(userRoutine))((clientData), (dsObj), (activeDnodeAccMask), (activeRecordAccMask), (activeAttributeAccMask))
  4159. #define CallDSAMDirProc(userRoutine, dsamData, paramBlock, async)        \
  4160.         (*(userRoutine))((dsamData), (paramBlock), (async))
  4161. #define CallDSAMDirParseProc(userRoutine, dsamData, paramBlock, async)        \
  4162.         (*(userRoutine))((dsamData), (paramBlock), (async))
  4163. #define CallDSAMAuthProc(userRoutine, dsamData, pb, async)        \
  4164.         (*(userRoutine))((dsamData), (pb), (async))
  4165. #endif
  4166.  
  4167. #if GENERATINGCFM
  4168. #define NewAuthIOCompletionProc(userRoutine)        \
  4169.         (AuthIOCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppAuthIOCompletionProcInfo, GetCurrentArchitecture())
  4170. #define NewNotificationProc(userRoutine)        \
  4171.         (NotificationUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppNotificationProcInfo, GetCurrentArchitecture())
  4172. #define NewDirIOCompletionProc(userRoutine)        \
  4173.         (DirIOCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDirIOCompletionProcInfo, GetCurrentArchitecture())
  4174. #define NewForEachDirEnumSpecProc(userRoutine)        \
  4175.         (ForEachDirEnumSpecUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachDirEnumSpecProcInfo, GetCurrentArchitecture())
  4176. #define NewForEachRecordProc(userRoutine)        \
  4177.         (ForEachRecordUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachRecordProcInfo, GetCurrentArchitecture())
  4178. #define NewForEachLookupRecordIDProc(userRoutine)        \
  4179.         (ForEachLookupRecordIDUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachLookupRecordIDProcInfo, GetCurrentArchitecture())
  4180. #define NewForEachAttrTypeLookupProc(userRoutine)        \
  4181.         (ForEachAttrTypeLookupUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachAttrTypeLookupProcInfo, GetCurrentArchitecture())
  4182. #define NewForEachAttrValueProc(userRoutine)        \
  4183.         (ForEachAttrValueUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachAttrValueProcInfo, GetCurrentArchitecture())
  4184. #define NewForEachAttrTypeProc(userRoutine)        \
  4185.         (ForEachAttrTypeUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachAttrTypeProcInfo, GetCurrentArchitecture())
  4186. #define NewForEachRecordIDProc(userRoutine)        \
  4187.         (ForEachRecordIDUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachRecordIDProcInfo, GetCurrentArchitecture())
  4188. #define NewForEachDirectoryProc(userRoutine)        \
  4189.         (ForEachDirectoryUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachDirectoryProcInfo, GetCurrentArchitecture())
  4190. #define NewForEachADAPDirectoryProc(userRoutine)        \
  4191.         (ForEachADAPDirectoryUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachADAPDirectoryProcInfo, GetCurrentArchitecture())
  4192. #define NewForEachDNodeAccessControlProc(userRoutine)        \
  4193.         (ForEachDNodeAccessControlUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachDNodeAccessControlProcInfo, GetCurrentArchitecture())
  4194. #define NewForEachRecordAccessControlProc(userRoutine)        \
  4195.         (ForEachRecordAccessControlUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachRecordAccessControlProcInfo, GetCurrentArchitecture())
  4196. #define NewForEachAttributeAccessControlProc(userRoutine)        \
  4197.         (ForEachAttributeAccessControlUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachAttributeAccessControlProcInfo, GetCurrentArchitecture())
  4198. #define NewDSAMDirProc(userRoutine)        \
  4199.         (DSAMDirUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDSAMDirProcInfo, GetCurrentArchitecture())
  4200. #define NewDSAMDirParseProc(userRoutine)        \
  4201.         (DSAMDirParseUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDSAMDirParseProcInfo, GetCurrentArchitecture())
  4202. #define NewDSAMAuthProc(userRoutine)        \
  4203.         (DSAMAuthUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDSAMAuthProcInfo, GetCurrentArchitecture())
  4204. #else
  4205. #define NewAuthIOCompletionProc(userRoutine)        \
  4206.         ((AuthIOCompletionUPP) (userRoutine))
  4207. #define NewNotificationProc(userRoutine)        \
  4208.         ((NotificationUPP) (userRoutine))
  4209. #define NewDirIOCompletionProc(userRoutine)        \
  4210.         ((DirIOCompletionUPP) (userRoutine))
  4211. #define NewForEachDirEnumSpecProc(userRoutine)        \
  4212.         ((ForEachDirEnumSpecUPP) (userRoutine))
  4213. #define NewForEachRecordProc(userRoutine)        \
  4214.         ((ForEachRecordUPP) (userRoutine))
  4215. #define NewForEachLookupRecordIDProc(userRoutine)        \
  4216.         ((ForEachLookupRecordIDUPP) (userRoutine))
  4217. #define NewForEachAttrTypeLookupProc(userRoutine)        \
  4218.         ((ForEachAttrTypeLookupUPP) (userRoutine))
  4219. #define NewForEachAttrValueProc(userRoutine)        \
  4220.         ((ForEachAttrValueUPP) (userRoutine))
  4221. #define NewForEachAttrTypeProc(userRoutine)        \
  4222.         ((ForEachAttrTypeUPP) (userRoutine))
  4223. #define NewForEachRecordIDProc(userRoutine)        \
  4224.         ((ForEachRecordIDUPP) (userRoutine))
  4225. #define NewForEachDirectoryProc(userRoutine)        \
  4226.         ((ForEachDirectoryUPP) (userRoutine))
  4227. #define NewForEachADAPDirectoryProc(userRoutine)        \
  4228.         ((ForEachADAPDirectoryUPP) (userRoutine))
  4229. #define NewForEachDNodeAccessControlProc(userRoutine)        \
  4230.         ((ForEachDNodeAccessControlUPP) (userRoutine))
  4231. #define NewForEachRecordAccessControlProc(userRoutine)        \
  4232.         ((ForEachRecordAccessControlUPP) (userRoutine))
  4233. #define NewForEachAttributeAccessControlProc(userRoutine)        \
  4234.         ((ForEachAttributeAccessControlUPP) (userRoutine))
  4235. #define NewDSAMDirProc(userRoutine)        \
  4236.         ((DSAMDirUPP) (userRoutine))
  4237. #define NewDSAMDirParseProc(userRoutine)        \
  4238.         ((DSAMDirParseUPP) (userRoutine))
  4239. #define NewDSAMAuthProc(userRoutine)        \
  4240.         ((DSAMAuthUPP) (userRoutine))
  4241. #endif
  4242.  
  4243.  
  4244. enum {
  4245.     kAuthBindSpecificIdentity    = 0x200,
  4246.     kAuthUnbindSpecificIdentity    = 0x201,
  4247.     kAuthResolveCreationID        = 0x202,
  4248.     kAuthGetSpecificIdentityInfo = 0x203,
  4249.     kAuthGetLocalIdentity        = 0x204,
  4250.     kAuthAddToLocalIdentityQueue = 0x205,
  4251.     kAuthRemoveFromLocalIdentityQueue = 0x206,
  4252.     kAuthAddKey                    = 0x207,
  4253.     kAuthChangeKey                = 0x208,
  4254.     kAuthDeleteKey                = 0x209,
  4255.     kAuthPasswordToKey            = 0x20A,
  4256.     kAuthGetCredentials            = 0x20B,
  4257.     kAuthDecryptCredentials        = 0x20C,
  4258.     kOCESetupRemoveDirectoryInfo = 0x20D,
  4259.     kOCESetupGetDirectoryInfo    = 0x20E,
  4260.     kAuthMakeChallenge            = 0x20F,
  4261.     kAuthMakeReply                = 0x210,
  4262.     kAuthVerifyReply            = 0x211,
  4263.     kAuthMakeProxy                = 0x212,
  4264.     kAuthTradeProxyForCredentials = 0x213,
  4265.     kAuthUnlockLocalIdentity    = 0x214,
  4266.     kAuthLockLocalIdentity        = 0x215,
  4267.     kAuthSetupLocalIdentity        = 0x216,
  4268.     kAuthChangeLocalIdentity    = 0x217,
  4269.     kAuthRemoveLocalIdentity    = 0x218,
  4270.     kOCESetupAddDirectoryInfo    = 0x219,
  4271.     kAuthGetUTCTime                = 0x21A,
  4272.     kOCESetupChangeDirectoryInfo = 0x21B,
  4273. /* 0x100 is used as private command */
  4274.     kDirEnumerateParse            = 0x101,
  4275.     kDirLookupParse                = 0x102,
  4276.     kDirEnumerateAttributeTypesParse = 0x103,
  4277.     kDirEnumeratePseudonymParse    = 0x104,
  4278.     kDirNetSearchADAPDirectoriesParse = 0x105,
  4279.     kDirEnumerateDirectoriesParse = 0x106,
  4280.     kDirFindADAPDirectoryByNetSearch = 0x107,
  4281.     kDirNetSearchADAPDirectoriesGet = 0x108,
  4282.     kDirAddRecord                = 0x109,
  4283.     kDirDeleteRecord            = 0x10A,
  4284.     kDirAddAttributeValue        = 0x10B,
  4285.     kDirDeleteAttributeValue    = 0x10C,
  4286.     kDirChangeAttributeValue    = 0x10D,
  4287.     kDirVerifyAttributeValue    = 0x10E,
  4288.     kDirAddPseudonym            = 0x10F,
  4289.     kDirDeletePseudonym            = 0x110,
  4290.     kDirEnumerateGet            = 0x111,
  4291.     kDirEnumerateAttributeTypesGet = 0x112,
  4292.     kDirEnumeratePseudonymGet    = 0x113,
  4293.     kDirGetNameAndType            = 0x114,
  4294.     kDirSetNameAndType            = 0x115,
  4295.     kDirGetRecordMetaInfo        = 0x116,
  4296.     kDirLookupGet                = 0x117,
  4297.     kDirGetDNodeMetaInfo        = 0x118,
  4298.     kDirGetDirectoryInfo        = 0x119,
  4299.     kDirEnumerateDirectoriesGet    = 0x11A,
  4300.     kDirAbort                    = 0x11B,
  4301.     kDirAddAlias                = 0x11C,
  4302.     kDirAddDSAM                    = 0x11D,
  4303.     kDirOpenPersonalDirectory    = 0x11E,
  4304.     kDirCreatePersonalDirectory    = 0x11F,
  4305.     kDirRemoveDSAM                = 0x120,
  4306.     kDirGetDirectoryIcon        = 0x121,
  4307.     kDirMapPathNameToDNodeNumber = 0x122,
  4308.     kDirMapDNodeNumberToPathName = 0x123,
  4309.     kDirGetLocalNetworkSpec        = 0x124,
  4310.     kDirGetDNodeInfo            = 0x125,
  4311.     kDirFindValue                = 0x126,
  4312.     kDirInstantiateDSAM            = 0x127,
  4313.     kDirGetOCESetupRefNum        = 0x128,
  4314.     kDirGetDNodeAccessControlGet = 0x12A,
  4315.     kDirGetRecordAccessControlGet = 0x12C,
  4316.     kDirGetAttributeAccessControlGet = 0x12E,
  4317.     kDirGetDNodeAccessControlParse = 0x12F,
  4318.     kDirDeleteAttributeType        = 0x130,
  4319.     kDirClosePersonalDirectory    = 0x131,
  4320.     kDirMakePersonalDirectoryRLI = 0x132,
  4321.     kDirAddDSAMDirectory        = 0x133,
  4322.     kDirGetRecordAccessControlParse = 0x134,
  4323.     kDirRemoveDirectory            = 0x135,
  4324.     kDirGetExtendedDirectoriesInfo = 0x136,
  4325.     kDirAddADAPDirectory        = 0x137,
  4326.     kDirGetAttributeAccessControlParse = 0x138,
  4327.     kDirFindRecordGet            = 0x140,
  4328.     kDirFindRecordParse            = 0x141
  4329. };
  4330.  
  4331. extern pascal OSErr AuthBindSpecificIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  4332.  THREEWORDINLINE(0x3F3C, 0x200, 0xAA5E);
  4333. extern pascal OSErr AuthUnbindSpecificIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  4334.  THREEWORDINLINE(0x3F3C, 0x201, 0xAA5E);
  4335. extern pascal OSErr AuthResolveCreationID(AuthParamBlockPtr paramBlock, Boolean async)
  4336.  THREEWORDINLINE(0x3F3C, 0x202, 0xAA5E);
  4337. extern pascal OSErr AuthGetSpecificIdentityInfo(AuthParamBlockPtr paramBlock, Boolean async)
  4338.  THREEWORDINLINE(0x3F3C, 0x203, 0xAA5E);
  4339. extern pascal OSErr AuthAddKey(AuthParamBlockPtr paramBlock, Boolean async)
  4340.  THREEWORDINLINE(0x3F3C, 0x207, 0xAA5E);
  4341. extern pascal OSErr AuthChangeKey(AuthParamBlockPtr paramBlock, Boolean async)
  4342.  THREEWORDINLINE(0x3F3C, 0x208, 0xAA5E);
  4343. extern pascal OSErr AuthDeleteKey(AuthParamBlockPtr paramBlock, Boolean async)
  4344.  THREEWORDINLINE(0x3F3C, 0x209, 0xAA5E);
  4345. extern pascal OSErr AuthPasswordToKey(AuthParamBlockPtr paramBlock, Boolean async)
  4346.  THREEWORDINLINE(0x3F3C, 0x20A, 0xAA5E);
  4347. extern pascal OSErr AuthGetCredentials(AuthParamBlockPtr paramBlock, Boolean async)
  4348.  THREEWORDINLINE(0x3F3C, 0x20B, 0xAA5E);
  4349. extern pascal OSErr AuthDecryptCredentials(AuthParamBlockPtr paramBlock, Boolean async)
  4350.  THREEWORDINLINE(0x3F3C, 0x20C, 0xAA5E);
  4351. extern pascal OSErr AuthMakeChallenge(AuthParamBlockPtr paramBlock, Boolean async)
  4352.  THREEWORDINLINE(0x3F3C, 0x20F, 0xAA5E);
  4353. extern pascal OSErr AuthMakeReply(AuthParamBlockPtr paramBlock, Boolean async)
  4354.  THREEWORDINLINE(0x3F3C, 0x210, 0xAA5E);
  4355. extern pascal OSErr AuthVerifyReply(AuthParamBlockPtr paramBlock, Boolean async)
  4356.  THREEWORDINLINE(0x3F3C, 0x211, 0xAA5E);
  4357. extern pascal OSErr AuthGetUTCTime(AuthParamBlockPtr paramBlock, Boolean async)
  4358.  THREEWORDINLINE(0x3F3C, 0x21A, 0xAA5E);
  4359. extern pascal OSErr AuthMakeProxy(AuthParamBlockPtr paramBlock, Boolean async)
  4360.  THREEWORDINLINE(0x3F3C, 0x212, 0xAA5E);
  4361. extern pascal OSErr AuthTradeProxyForCredentials(AuthParamBlockPtr paramBlock, Boolean async)
  4362.  THREEWORDINLINE(0x3F3C, 0x213, 0xAA5E);
  4363. /* Local Identity API */
  4364. extern pascal OSErr AuthGetLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  4365.  THREEWORDINLINE(0x3F3C, 0x204, 0xAA5E);
  4366. extern pascal OSErr AuthUnlockLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  4367.  THREEWORDINLINE(0x3F3C, 0x214, 0xAA5E);
  4368. extern pascal OSErr AuthLockLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  4369.  THREEWORDINLINE(0x3F3C, 0x215, 0xAA5E);
  4370. extern pascal OSErr AuthAddToLocalIdentityQueue(AuthParamBlockPtr paramBlock, Boolean async)
  4371.  THREEWORDINLINE(0x3F3C, 0x205, 0xAA5E);
  4372. extern pascal OSErr AuthRemoveFromLocalIdentityQueue(AuthParamBlockPtr paramBlock, Boolean async)
  4373.  THREEWORDINLINE(0x3F3C, 0x206, 0xAA5E);
  4374. extern pascal OSErr AuthSetupLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  4375.  THREEWORDINLINE(0x3F3C, 0x216, 0xAA5E);
  4376. extern pascal OSErr AuthChangeLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  4377.  THREEWORDINLINE(0x3F3C, 0x217, 0xAA5E);
  4378. extern pascal OSErr AuthRemoveLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  4379.  THREEWORDINLINE(0x3F3C, 0x218, 0xAA5E);
  4380. extern pascal OSErr OCESetupAddDirectoryInfo(AuthParamBlockPtr paramBlock, Boolean async)
  4381.  THREEWORDINLINE(0x3F3C, 0x219, 0xAA5E);
  4382. extern pascal OSErr OCESetupChangeDirectoryInfo(AuthParamBlockPtr paramBlock, Boolean async)
  4383.  THREEWORDINLINE(0x3F3C, 0x21B, 0xAA5E);
  4384. extern pascal OSErr OCESetupRemoveDirectoryInfo(AuthParamBlockPtr paramBlock, Boolean async)
  4385.  THREEWORDINLINE(0x3F3C, 0x20D, 0xAA5E);
  4386. extern pascal OSErr OCESetupGetDirectoryInfo(AuthParamBlockPtr paramBlock, Boolean async)
  4387.  THREEWORDINLINE(0x3F3C, 0x20E, 0xAA5E);
  4388. extern pascal OSErr DirAddRecord(DirParamBlockPtr paramBlock, Boolean async)
  4389.  THREEWORDINLINE(0x3F3C, 0x109, 0xAA5E);
  4390. extern pascal OSErr DirDeleteRecord(DirParamBlockPtr paramBlock, Boolean async)
  4391.  THREEWORDINLINE(0x3F3C, 0x10A, 0xAA5E);
  4392. extern pascal OSErr DirEnumerateGet(DirParamBlockPtr paramBlock, Boolean async)
  4393.  THREEWORDINLINE(0x3F3C, 0x111, 0xAA5E);
  4394. extern pascal OSErr DirEnumerateParse(DirParamBlockPtr paramBlock, Boolean async)
  4395.  THREEWORDINLINE(0x3F3C, 0x101, 0xAA5E);
  4396. extern pascal OSErr DirFindRecordGet(DirParamBlockPtr paramBlock, Boolean async)
  4397.  THREEWORDINLINE(0x3F3C, 0x140, 0xAA5E);
  4398. extern pascal OSErr DirFindRecordParse(DirParamBlockPtr paramBlock, Boolean async)
  4399.  THREEWORDINLINE(0x3F3C, 0x141, 0xAA5E);
  4400. extern pascal OSErr DirLookupGet(DirParamBlockPtr paramBlock, Boolean async)
  4401.  THREEWORDINLINE(0x3F3C, 0x117, 0xAA5E);
  4402. extern pascal OSErr DirLookupParse(DirParamBlockPtr paramBlock, Boolean async)
  4403.  THREEWORDINLINE(0x3F3C, 0x102, 0xAA5E);
  4404. extern pascal OSErr DirAddAttributeValue(DirParamBlockPtr paramBlock, Boolean async)
  4405.  THREEWORDINLINE(0x3F3C, 0x10B, 0xAA5E);
  4406. extern pascal OSErr DirDeleteAttributeValue(DirParamBlockPtr paramBlock, Boolean async)
  4407.  THREEWORDINLINE(0x3F3C, 0x10C, 0xAA5E);
  4408. extern pascal OSErr DirDeleteAttributeType(DirParamBlockPtr paramBlock, Boolean async)
  4409.  THREEWORDINLINE(0x3F3C, 0x130, 0xAA5E);
  4410. extern pascal OSErr DirChangeAttributeValue(DirParamBlockPtr paramBlock, Boolean async)
  4411.  THREEWORDINLINE(0x3F3C, 0x10D, 0xAA5E);
  4412. extern pascal OSErr DirVerifyAttributeValue(DirParamBlockPtr paramBlock, Boolean async)
  4413.  THREEWORDINLINE(0x3F3C, 0x10E, 0xAA5E);
  4414. extern pascal OSErr DirFindValue(DirParamBlockPtr paramBlock, Boolean async)
  4415.  THREEWORDINLINE(0x3F3C, 0x126, 0xAA5E);
  4416. extern pascal OSErr DirEnumerateAttributeTypesGet(DirParamBlockPtr paramBlock, Boolean async)
  4417.  THREEWORDINLINE(0x3F3C, 0x112, 0xAA5E);
  4418. extern pascal OSErr DirEnumerateAttributeTypesParse(DirParamBlockPtr paramBlock, Boolean async)
  4419.  THREEWORDINLINE(0x3F3C, 0x103, 0xAA5E);
  4420. extern pascal OSErr DirAddPseudonym(DirParamBlockPtr paramBlock, Boolean async)
  4421.  THREEWORDINLINE(0x3F3C, 0x10F, 0xAA5E);
  4422. extern pascal OSErr DirDeletePseudonym(DirParamBlockPtr paramBlock, Boolean async)
  4423.  THREEWORDINLINE(0x3F3C, 0x110, 0xAA5E);
  4424. extern pascal OSErr DirAddAlias(DirParamBlockPtr paramBlock, Boolean async)
  4425.  THREEWORDINLINE(0x3F3C, 0x11C, 0xAA5E);
  4426. extern pascal OSErr DirEnumeratePseudonymGet(DirParamBlockPtr paramBlock, Boolean async)
  4427.  THREEWORDINLINE(0x3F3C, 0x113, 0xAA5E);
  4428. extern pascal OSErr DirEnumeratePseudonymParse(DirParamBlockPtr paramBlock, Boolean async)
  4429.  THREEWORDINLINE(0x3F3C, 0x104, 0xAA5E);
  4430. extern pascal OSErr DirGetNameAndType(DirParamBlockPtr paramBlock, Boolean async)
  4431.  THREEWORDINLINE(0x3F3C, 0x114, 0xAA5E);
  4432. extern pascal OSErr DirSetNameAndType(DirParamBlockPtr paramBlock, Boolean async)
  4433.  THREEWORDINLINE(0x3F3C, 0x115, 0xAA5E);
  4434. extern pascal OSErr DirGetRecordMetaInfo(DirParamBlockPtr paramBlock, Boolean async)
  4435.  THREEWORDINLINE(0x3F3C, 0x116, 0xAA5E);
  4436. extern pascal OSErr DirGetDNodeMetaInfo(DirParamBlockPtr paramBlock, Boolean async)
  4437.  THREEWORDINLINE(0x3F3C, 0x118, 0xAA5E);
  4438. extern pascal OSErr DirGetDirectoryInfo(DirParamBlockPtr paramBlock, Boolean async)
  4439.  THREEWORDINLINE(0x3F3C, 0x119, 0xAA5E);
  4440. extern pascal OSErr DirGetDNodeAccessControlGet(DirParamBlockPtr paramBlock, Boolean async)
  4441.  THREEWORDINLINE(0x3F3C, 0x12A, 0xAA5E);
  4442. extern pascal OSErr DirGetDNodeAccessControlParse(DirParamBlockPtr paramBlock, Boolean async)
  4443.  THREEWORDINLINE(0x3F3C, 0x12F, 0xAA5E);
  4444. extern pascal OSErr DirGetRecordAccessControlGet(DirParamBlockPtr paramBlock, Boolean async)
  4445.  THREEWORDINLINE(0x3F3C, 0x12C, 0xAA5E);
  4446. extern pascal OSErr DirGetRecordAccessControlParse(DirParamBlockPtr paramBlock, Boolean async)
  4447.  THREEWORDINLINE(0x3F3C, 0x134, 0xAA5E);
  4448. extern pascal OSErr DirGetAttributeAccessControlGet(DirParamBlockPtr paramBlock, Boolean async)
  4449.  THREEWORDINLINE(0x3F3C, 0x12E, 0xAA5E);
  4450. extern pascal OSErr DirGetAttributeAccessControlParse(DirParamBlockPtr paramBlock, Boolean async)
  4451.  THREEWORDINLINE(0x3F3C, 0x138, 0xAA5E);
  4452. extern pascal OSErr DirEnumerateDirectoriesGet(DirParamBlockPtr paramBlock, Boolean async)
  4453.  THREEWORDINLINE(0x3F3C, 0x11A, 0xAA5E);
  4454. extern pascal OSErr DirEnumerateDirectoriesParse(DirParamBlockPtr paramBlock, Boolean async)
  4455.  THREEWORDINLINE(0x3F3C, 0x106, 0xAA5E);
  4456. extern pascal OSErr DirMapPathNameToDNodeNumber(DirParamBlockPtr paramBlock, Boolean async)
  4457.  THREEWORDINLINE(0x3F3C, 0x122, 0xAA5E);
  4458. extern pascal OSErr DirMapDNodeNumberToPathName(DirParamBlockPtr paramBlock, Boolean async)
  4459.  THREEWORDINLINE(0x3F3C, 0x123, 0xAA5E);
  4460. extern pascal OSErr DirGetLocalNetworkSpec(DirParamBlockPtr paramBlock, Boolean async)
  4461.  THREEWORDINLINE(0x3F3C, 0x124, 0xAA5E);
  4462. extern pascal OSErr DirGetDNodeInfo(DirParamBlockPtr paramBlock, Boolean async)
  4463.  THREEWORDINLINE(0x3F3C, 0x125, 0xAA5E);
  4464. /*  Trap Dispatchers for Personal Catalog and CSAM Extensions */
  4465. extern pascal OSErr DirCreatePersonalDirectory(DirParamBlockPtr paramBlock)
  4466.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x11F, 0xAA5E);
  4467. extern pascal OSErr DirOpenPersonalDirectory(DirParamBlockPtr paramBlock)
  4468.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x11E, 0xAA5E);
  4469. extern pascal OSErr DirClosePersonalDirectory(DirParamBlockPtr paramBlock)
  4470.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x131, 0xAA5E);
  4471. extern pascal OSErr DirMakePersonalDirectoryRLI(DirParamBlockPtr paramBlock)
  4472.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x132, 0xAA5E);
  4473. extern pascal OSErr DirAddDSAM(DirParamBlockPtr paramBlock)
  4474.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x11D, 0xAA5E);
  4475. extern pascal OSErr DirInstantiateDSAM(DirParamBlockPtr paramBlock)
  4476.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x127, 0xAA5E);
  4477. extern pascal OSErr DirRemoveDSAM(DirParamBlockPtr paramBlock)
  4478.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x120, 0xAA5E);
  4479. extern pascal OSErr DirAddDSAMDirectory(DirParamBlockPtr paramBlock, Boolean async)
  4480.  THREEWORDINLINE(0x3F3C, 0x133, 0xAA5E);
  4481. extern pascal OSErr DirGetExtendedDirectoriesInfo(DirParamBlockPtr paramBlock, Boolean async)
  4482.  THREEWORDINLINE(0x3F3C, 0x136, 0xAA5E);
  4483. extern pascal OSErr DirGetDirectoryIcon(DirParamBlockPtr paramBlock, Boolean async)
  4484.  THREEWORDINLINE(0x3F3C, 0x121, 0xAA5E);
  4485. extern pascal OSErr DirAddADAPDirectory(DirParamBlockPtr paramBlock, Boolean async)
  4486.  THREEWORDINLINE(0x3F3C, 0x137, 0xAA5E);
  4487. extern pascal OSErr DirRemoveDirectory(DirParamBlockPtr paramBlock, Boolean async)
  4488.  THREEWORDINLINE(0x3F3C, 0x135, 0xAA5E);
  4489. extern pascal OSErr DirNetSearchADAPDirectoriesGet(DirParamBlockPtr paramBlock, Boolean async)
  4490.  THREEWORDINLINE(0x3F3C, 0x108, 0xAA5E);
  4491. extern pascal OSErr DirNetSearchADAPDirectoriesParse(DirParamBlockPtr paramBlock, Boolean async)
  4492.  THREEWORDINLINE(0x3F3C, 0x105, 0xAA5E);
  4493. extern pascal OSErr DirFindADAPDirectoryByNetSearch(DirParamBlockPtr paramBlock, Boolean async)
  4494.  THREEWORDINLINE(0x3F3C, 0x107, 0xAA5E);
  4495. extern pascal OSErr DirGetOCESetupRefNum(DirParamBlockPtr paramBlock, Boolean async)
  4496.  THREEWORDINLINE(0x3F3C, 0x128, 0xAA5E);
  4497. extern pascal OSErr DirAbort(DirParamBlockPtr paramBlock)
  4498.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x11B, 0xAA5E);
  4499.  
  4500. #if PRAGMA_IMPORT_SUPPORTED
  4501. #pragma import off
  4502. #endif
  4503.  
  4504. #if PRAGMA_ALIGN_SUPPORTED
  4505. #pragma options align=reset
  4506. #endif
  4507.  
  4508. #ifdef __cplusplus
  4509. }
  4510. #endif
  4511.  
  4512. #endif /* __OCEAUTHDIR__ */
  4513.